From 825630b151f2329d1bc875f26f2e31d6b4032813 Mon Sep 17 00:00:00 2001 From: di0ib Date: Fri, 18 Dec 2020 16:27:20 +0000 Subject: [PATCH] Upload files to '' --- ROT-ProMicro.ino | 31 +++++++++++++++++++++++++++++++ ROT-xiao.ino | 31 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 ROT-ProMicro.ino create mode 100644 ROT-xiao.ino 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); +}