From 9a3ad8f9fd926bce826263a4326824ea2d009a28 Mon Sep 17 00:00:00 2001 From: di0ib Date: Fri, 23 Jun 2017 05:51:10 -1000 Subject: [PATCH] 2pack --- 2pack/2pack.ino | 77 ++++++++++++++++++++++++++++++++++++++++++ 2pack/logo/Osu_bw.bmp | Bin 0 -> 147010 bytes 2 files changed, 77 insertions(+) create mode 100644 2pack/2pack.ino create mode 100644 2pack/logo/Osu_bw.bmp diff --git a/2pack/2pack.ino b/2pack/2pack.ino new file mode 100644 index 0000000..dee402d --- /dev/null +++ b/2pack/2pack.ino @@ -0,0 +1,77 @@ +#include "HID-Project.h" + +//debounce milliseconds +const int debounce = 10; +//Switch Pins +const byte k[2] = { 2, 3 }; +//Switch status +boolean s[2] = { 0, 0 }; +//LED Pins +const byte l[2] = { 10, 9 }; + +//M for Media Key, K for Keyboard +const char codetype[6] = { 'K', 'K' }; + +//Keycodes +const ConsumerKeycode ccode[2] = { MEDIA_VOLUME_MUTE, + MEDIA_PLAY_PAUSE + }; + +const KeyboardKeycode kcode[2] = { KEY_UP_ARROW, + KEY_DOWN_ARROW + }; + +void setup() { + Keyboard.begin(); + Consumer.begin(); + + //setup inputs, turn on pullups + for (int i = 0; i <= 1; i++) { + pinMode(k[i], INPUT); + digitalWrite(k[i], 1); + pinMode(l[i], OUTPUT); + } +} + +void loop() { + CheckKeys(); + delay(debounce); +} + +void CheckKeys() { + for (int i = 0; i <= 1; i++) { + if (codetype[i] == 'M') { + if (digitalRead(k[i]) == 0) { + if (s[i] == 0) { + Consumer.press((ccode[i])); + s[i] = 1; + digitalWrite(l[i], 1); + } + } + else { + if (s[i] == 1) { + s[i] = 0; + digitalWrite(l[i], 0); + Consumer.release((ccode[i])); + } + } + } + if (codetype[i] == 'K') { + if (digitalRead(k[i]) == 0) { + if (s[i] == 0) { + Keyboard.press((kcode[i])); + s[i] = 1; + digitalWrite(l[i], 1); + } + } + else { + if (s[i] == 1) { + s[i] = 0; + digitalWrite(l[i], 0); + Keyboard.release((kcode[i])); + } + } + } + } +} + diff --git a/2pack/logo/Osu_bw.bmp b/2pack/logo/Osu_bw.bmp new file mode 100644 index 0000000000000000000000000000000000000000..eca46db6f2b5430c11a96732a1ac8b4711a0b3b8 GIT binary patch literal 147010 zcmeI5JFe|Ia)x(z8?XTfH*n%i({N%7xQQbt9)~lh1|)c78j1iS`AAi*6zpp?4asBzHzcGLQ@bd@N{d4^DAAkPg z?|<|kb*K9C`@jDCf2wOWA7h1&_M`};3h>s9kEsV&fVXCROg*>) zyfx!v>cJJ@tr;Iv53T@j&G?vla0Pg4#>doyE5KVbKBgXA0p6PNG4z*{purXE}Y-kR|-_23Hd z){Kv-2Umc%W_(ONxB|R2<74W<72vJEqWIW<{=lEDrS(*gKf~X={;kD08S{{X{QYk- zX~XFwj=vC$pP#M4ydCm{gJV1cdBVZeP!0QZ^(PO;?jFa3ylLmaOrbRGS<}q%f7HG` zU+X<$Ml^Hm);2w9_Dm~B$SVq{)ibReR0MY3=$J;1m>kW5v~jo_!}14s+U&dqwQmZI9g5nfp+%~~%= z1II~C2G1K(w}B&Qns>gTM=nYg(NYakugAe3J=pq_JV$D2xtX?FkZL{BwG>IJYic#e zj;4~w>Jn1RkuM&GZ>@ApEk~JK>KD6Ojxx9WRR0K|lA|nJlxr$8rjn!7E!B>x_u}iJsIB@#nV?}AN;3zhK-zedi`tYa;ka9ih!=q+XR?czUau=VK2S_tZ!JvRLXMV2&hV^dAcY*QVOkuhg&ZdryP{QC z$qG643d{V~!b(=i!RM}O^^A}9FfHAamFdx1#guSmm8^{8tnviExhzo2ICegDRjVve z%Q&hGyEhjFY7xhiFf9z!B98WIsCeLv`hzlH=PnbN%fs;Kr<`X8*@xc5&G@CG4jvnb!kT6+}9_dn$FjQLUTK?6+zdyr zbjc=6hU0u37dSy?rOR*}IL+f@CUG+y`(yh!K_+oC95_pdV>)ru9R1QZm$+$;ercOa z+%!kOw9O@Mn&a#c7dS;aanl?JPSW9+PTVxd-oZXjkxtw+2hP#um`vOx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