diff --git a/ROT-ProMicro.ino b/ROT-ProMicro.ino new file mode 100644 index 0000000..c1a2edd --- /dev/null +++ b/ROT-ProMicro.ino @@ -0,0 +1,31 @@ +#include +#include + +CommonBusEncoders encoders(15, 19, 4, 1); + +void setup() { + + //Setup encoder + encoders.setDebounce(16); + encoders.resetChronoAfter(10000); + encoders.addEncoder(1, 2, 18, 1, 100, 199); + pinMode(6, OUTPUT); + digitalWrite(6, LOW); + + //Start Consumer keyboard + Consumer.begin(); + + //Serial debugging + //Serial.begin(9600); +} + +void loop() { + + int code = encoders.readAll(); + if (code != 0) { + //Serial.println(code); + } + if (code == 101) Consumer.write(MEDIA_VOLUME_DOWN); + if (code == 100) Consumer.write(MEDIA_VOLUME_UP); + if (code == 199) Consumer.write(MEDIA_VOLUME_MUTE); +} diff --git a/ROT-xiao.ino b/ROT-xiao.ino new file mode 100644 index 0000000..1425e4c --- /dev/null +++ b/ROT-xiao.ino @@ -0,0 +1,31 @@ +#include +#include + +CommonBusEncoders encoders(8, 10, 3, 1); + +void setup() { + + //Setup encoder + encoders.setDebounce(16); + encoders.resetChronoAfter(10000); + encoders.addEncoder(1, 2, 9, 1, 100, 199); + pinMode(5, OUTPUT); + digitalWrite(5, LOW); + + //Start Consumer keyboard + Consumer.begin(); + + //Serial debugging + //Serial.begin(9600); +} + +void loop() { + + int code = encoders.readAll(); + if (code != 0) { + //Serial.println(code); + } + if (code == 101) Consumer.write(MEDIA_VOLUME_DOWN); + if (code == 100) Consumer.write(MEDIA_VOLUME_UP); + if (code == 199) Consumer.write(MEDIA_VOLUME_MUTE); +}