Components and supplies
Keyboard Stabilizer (Cherry style PCB Screw In)
Right Angle Single Row Male Header 2.54mm Pitch
Extensive Keycap Set (Cherry Style)
Arduino Micro
3.6V 0.5W Zener Diode
Keyboard Switch (Cherry or Kailh style)
Female Pin Header Breakaway 2.54mm Pitch
Micro-USB to USB Cable (Generic)
Female/Female Jumper Wires
Tools and machines
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Soldering iron (generic)
Apps and platforms
Arduino IDE
KiCad
Project description
Code
49KB.ino
c_cpp
The C++ File for the Arduino/PCB.
1#include <Keyboard.h> 2 3const int r0 = 2; 4const int r1 = 3; 5const int r2 = 4; 6const int r3 = 5; 7 8const int c0 = 6; 9const int c1 = 7; 10const int c2 = 8; 11const int c3 = 9; 12const int c4 = 10; 13const int c5 = 11; 14const int c6 = 12; 15const int c7 = 13; 16const int c8 = 14; 17const int c9 = 15; 18const int c10 = 16; 19const int c11 = 17; 20const int c12 = 18; 21const int c13 = 19; 22 23int layer = 0; //which layer of characters. 0 being alpha; 1 being num, mods, f row; 2 being gamr mode (replace wasd with arrows) 24bool modeHold = false; //if you are holding the mode button 25 26void setup() { 27 pinMode(c0, OUTPUT); 28 pinMode(c1, OUTPUT); 29 pinMode(c2, OUTPUT); 30 pinMode(c3, OUTPUT); 31 pinMode(c4, OUTPUT); 32 pinMode(c5, OUTPUT); 33 pinMode(c6, OUTPUT); 34 pinMode(c7, OUTPUT); 35 pinMode(c8, OUTPUT); 36 pinMode(c9, OUTPUT); 37 pinMode(c10, OUTPUT); 38 pinMode(c11, OUTPUT); 39 pinMode(c12, OUTPUT); 40 pinMode(c13, OUTPUT); 41 42 digitalWrite(c0, HIGH); 43 digitalWrite(c1, HIGH); 44 digitalWrite(c2, HIGH); 45 digitalWrite(c3, HIGH); 46 digitalWrite(c4, HIGH); 47 digitalWrite(c5, HIGH); 48 digitalWrite(c6, HIGH); 49 digitalWrite(c7, HIGH); 50 digitalWrite(c8, HIGH); 51 digitalWrite(c9, HIGH); 52 digitalWrite(c10, HIGH); 53 digitalWrite(c11, HIGH); 54 digitalWrite(c12, HIGH); 55 digitalWrite(c13, HIGH); 56 57 pinMode(r0, INPUT_PULLUP); 58 pinMode(r1, INPUT_PULLUP); 59 pinMode(r2, INPUT_PULLUP); 60 pinMode(r3, INPUT_PULLUP); 61 62 Keyboard.begin(); 63 64} 65 66void loop() { 67 68 digitalWrite(c0, LOW); 69 if (digitalRead(r0) == 0) { 70 if ((layer == 0) or (layer == 2)) Keyboard.press(KEY_ESC); 71 if (layer == 1) Keyboard.press(KEY_TAB); 72 } else { Keyboard.release(KEY_ESC); Keyboard.release(KEY_TAB); } 73 if (digitalRead(r1) == 0) { 74 Keyboard.press(KEY_CAPS_LOCK); 75 } else { Keyboard.release(KEY_CAPS_LOCK); } 76 if (digitalRead(r2) == 0) { 77 Keyboard.press(KEY_LEFT_SHIFT); 78 } else { Keyboard.release(KEY_LEFT_SHIFT); } 79 if (digitalRead(r3) == 0) { 80 Keyboard.press(KEY_LEFT_CTRL); 81 } else { Keyboard.release(KEY_LEFT_CTRL); } 82 digitalWrite(c0, HIGH); 83 84 digitalWrite(c1, LOW); 85 if (digitalRead(r0) == 0) { 86 if ((layer == 0) or (layer == 2)) Keyboard.press ('q'); 87 if (layer == 1) Keyboard.press('1'); 88 } else { Keyboard.release('q'); Keyboard.release('1'); } 89 if (digitalRead(r1) == 0) { 90 if (layer == 0) Keyboard.press ('a'); 91 if (layer == 1) Keyboard.press(KEY_F1); 92 if (layer == 2) Keyboard.press(KEY_LEFT_ARROW); 93 } else { Keyboard.release('a'); Keyboard.release(KEY_F1); Keyboard.release(KEY_LEFT_ARROW); } 94 if (digitalRead(r2) == 0) { 95 if ((layer == 0) or (layer == 2)) Keyboard.press ('z'); 96 if (layer == 1) Keyboard.press(KEY_F12); 97 } else { Keyboard.release('z'); Keyboard.release(KEY_F12); } 98 if (digitalRead(r3) == 0) { 99 Keyboard.press(KEY_LEFT_GUI); 100 } else { Keyboard.release(KEY_LEFT_GUI); } 101 digitalWrite(c1, HIGH); 102 103 digitalWrite(c2, LOW); 104 if (digitalRead(r0) == 0) { 105 if (layer == 0) Keyboard.press ('w'); 106 if (layer == 1) Keyboard.press('2'); 107 if (layer == 2) Keyboard.press(KEY_UP_ARROW); 108 } else { Keyboard.release('w'); Keyboard.release('2'); Keyboard.release(KEY_UP_ARROW); } 109 if (digitalRead(r1) == 0) { 110 if (layer == 0) Keyboard.press ('s'); 111 if (layer == 1) Keyboard.press(KEY_F2); 112 if (layer == 2) Keyboard.press(KEY_DOWN_ARROW); 113 } else { Keyboard.release('a'); Keyboard.release(KEY_F2); Keyboard.release(KEY_DOWN_ARROW); } 114 if (digitalRead(r2) == 0) { 115 if ((layer == 0) or (layer == 2)) Keyboard.press ('x'); 116 if (layer == 1) Keyboard.press(KEY_F13); 117 } else { Keyboard.release('x'); Keyboard.release(KEY_F13); } 118 if (digitalRead(r3) == 0) { 119 Keyboard.press(KEY_LEFT_ALT); //operating system 120 } else { Keyboard.release(KEY_LEFT_ALT); } 121 digitalWrite(c2, HIGH); 122 123 digitalWrite(c3, LOW); 124 if (digitalRead(r0) == 0) { 125 if ((layer == 0) or (layer == 2)) Keyboard.press ('e'); 126 if (layer == 1) Keyboard.press('3'); 127 } else { Keyboard.release('e'); Keyboard.release('3'); } 128 if (digitalRead(r1) == 0) { 129 if (layer == 0) Keyboard.press ('d'); 130 if (layer == 1) Keyboard.press(KEY_F3); 131 if (layer == 2) Keyboard.press(KEY_RIGHT_ARROW); 132 } else { Keyboard.release('d'); Keyboard.release(KEY_F3); Keyboard.release(KEY_RIGHT_ARROW); } 133 digitalWrite(c3, LOW); 134 if (digitalRead(r0) == 0) { 135 if ((layer == 0) or (layer == 2)) Keyboard.press ('c'); 136 if (layer == 1) Keyboard.press(KEY_F14); 137 } else { Keyboard.release('c'); Keyboard.release(KEY_F14); } 138 digitalWrite(c3, HIGH); 139 140 digitalWrite(c4, LOW); 141 if (digitalRead(r0) == 0) { 142 if ((layer == 0) or (layer == 2)) Keyboard.press ('r'); 143 if (layer == 1) Keyboard.press('4'); 144 } else { Keyboard.release('r'); Keyboard.release('4'); } 145 if (digitalRead(r1) == 0) { 146 if ((layer == 0) or (layer == 2)) Keyboard.press ('f'); 147 if (layer == 1) Keyboard.press(KEY_F4); 148 } else { Keyboard.release('f'); Keyboard.release(KEY_F4); } 149 if (digitalRead(r0) == 0) { 150 if ((layer == 0) or (layer == 2)) Keyboard.press ('v'); 151 if (layer == 1) Keyboard.press(KEY_F15); 152 } else { Keyboard.release('v'); Keyboard.release(KEY_F15); } 153 if (digitalRead(r3) == 0) { 154 Keyboard.press(' '); 155 } else { Keyboard.release(' '); } 156 digitalWrite(c4, HIGH); 157 158 digitalWrite(c5, LOW); 159 if (digitalRead(r0) == 0) { 160 if ((layer == 0) or (layer == 2)) Keyboard.press ('t'); 161 if (layer == 1) Keyboard.press('5'); 162 } else { Keyboard.release('t'); Keyboard.release('5'); } 163 if (digitalRead(r1) == 0) { 164 if ((layer == 0) or (layer == 2)) Keyboard.press ('g'); 165 if (layer == 1) Keyboard.press(KEY_F5); 166 } else { Keyboard.release('g'); Keyboard.release(KEY_F5); } 167 if (digitalRead(r2) == 0) { 168 if ((layer == 0) or (layer == 2)) Keyboard.press ('b'); 169 if (layer == 1) Keyboard.press(206); 170 } else { Keyboard.release('b'); Keyboard.release(206); } //prntscreen ascii 206 171 digitalWrite(c5, HIGH); 172 173 digitalWrite(c6, LOW); 174 if (digitalRead(r0) == 0) { 175 if ((layer == 0) or (layer == 2)) Keyboard.press ('['); 176 if (layer == 1) Keyboard.press('6'); 177 } else { Keyboard.release('['); Keyboard.release('6'); } 178 if (digitalRead(r1) == 0) { 179 if ((layer == 0) or (layer == 2)) Keyboard.press (';'); 180 if (layer == 1) Keyboard.press(KEY_F6); 181 } else { Keyboard.release(';'); Keyboard.release(KEY_F6); } 182 if (digitalRead(r2) == 0) { 183 if ((layer == 0) or (layer == 2)) Keyboard.press (','); 184 if (layer == 1) Keyboard.press(KEY_INSERT); 185 } else { Keyboard.release(','); Keyboard.release(KEY_INSERT); } 186 if (digitalRead(r3) == 0) { 187 if (modeHold == false) { 188 if (layer == 0) { 189 layer = 1; 190 } else if (layer == 1) { 191 layer = 2; 192 } else if (layer == 2) { layer = 0; } 193 modeHold = true; 194 } 195 } else { modeHold = false; } 196 digitalWrite(c6, HIGH); 197 198 digitalWrite(c7, LOW); 199 if (digitalRead(r0) == 0) { 200 if ((layer == 0) or (layer == 2)) Keyboard.press (']'); 201 if (layer == 1) Keyboard.press('7'); 202 } else { Keyboard.release(']'); Keyboard.release('7'); } 203 if (digitalRead(r1) == 0) { 204 if ((layer == 0) or (layer == 2)) Keyboard.press ('\\''); // \\' meant for ' so more like " ' " 205 if (layer == 1) Keyboard.press(KEY_F7); 206 } else { Keyboard.release('\\''); Keyboard.release(KEY_F7); } 207 if (digitalRead(r2) == 0) { 208 if ((layer == 0) or (layer == 2)) Keyboard.press ('.'); 209 if (layer == 1) Keyboard.press(KEY_HOME); 210 } else { Keyboard.release('.'); Keyboard.release(KEY_HOME); } 211 digitalWrite(c7, HIGH); 212 213 digitalWrite(c8, LOW); 214 if (digitalRead(r0) == 0) { 215 if ((layer == 0) or (layer == 2)) Keyboard.press ('y'); 216 if (layer == 1) Keyboard.press('8'); 217 } else { Keyboard.release('y'); Keyboard.release('8'); } 218 if (digitalRead(r1) == 0) { 219 if ((layer == 0) or (layer == 2)) Keyboard.press ('h'); 220 if (layer == 1) Keyboard.press(KEY_F8); 221 } else { Keyboard.release('h'); Keyboard.release(KEY_F8); } 222 if (digitalRead(r2) == 0) { 223 if ((layer == 0) or (layer == 2)) Keyboard.press ('n'); 224 if (layer == 1) Keyboard.press(KEY_PAGE_UP); 225 } else { Keyboard.release('n'); Keyboard.release(KEY_PAGE_UP); } 226 if (digitalRead(r2) == 0) { Keyboard.press(' '); } else { Keyboard.release(' '); } 227 digitalWrite(c8, HIGH); 228 229 digitalWrite(c9, LOW); 230 if (digitalRead(r0) == 0) { 231 if ((layer == 0) or (layer == 2)) Keyboard.press ('u'); 232 if (layer == 1) Keyboard.press('9'); 233 } else { Keyboard.release('u'); Keyboard.release('9'); } 234 if (digitalRead(r1) == 0) { 235 if ((layer == 0) or (layer == 2)) Keyboard.press ('j'); 236 if (layer == 1) Keyboard.press(KEY_F9); 237 } else { Keyboard.release('j'); Keyboard.release(KEY_F9); } 238 if (digitalRead(r2) == 0) { 239 if ((layer == 0) or (layer == 2)) Keyboard.press ('m'); 240 if (layer == 1) Keyboard.press(KEY_PAGE_DOWN); 241 } else { Keyboard.release(KEY_PAGE_DOWN); Keyboard.release('m'); } 242 digitalWrite(c9, HIGH); 243 244 digitalWrite(c10, LOW); 245 if (digitalRead(r0) == 0) { 246 if ((layer == 0) or (layer == 2)) Keyboard.press ('i'); 247 if (layer == 1) Keyboard.press('0'); 248 } else { Keyboard.release('i'); Keyboard.release('0'); } 249 if (digitalRead(r1) == 0) { 250 if ((layer == 0) or (layer == 2)) Keyboard.press ('k'); 251 if (layer == 1) Keyboard.press(KEY_F10); 252 } else { Keyboard.release('k'); Keyboard.release(KEY_F10); } 253 if (digitalRead(r2) == 0) { 254 if ((layer == 0) or (layer == 2)) Keyboard.press ('/'); 255 if (layer == 1) Keyboard.press(KEY_END); 256 } else { Keyboard.release(KEY_END); Keyboard.release('/'); } 257 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_ALT); } else { Keyboard.release(KEY_RIGHT_ALT); } 258 digitalWrite(c10, HIGH); 259 260 digitalWrite(c11, LOW); 261 if (digitalRead(r0) == 0) { 262 if ((layer == 0) or (layer == 2)) Keyboard.press ('o'); 263 if (layer == 1) Keyboard.press('-'); 264 } else { Keyboard.release('-'); Keyboard.release('o'); } 265 if (digitalRead(r1) == 0) { 266 if ((layer == 0) or (layer == 2)) Keyboard.press ('l'); 267 if (layer == 1) Keyboard.press(KEY_F11); 268 } else { Keyboard.release('l'); Keyboard.release(KEY_F11); }//start A circut 269 if (digitalRead(r2) == 0) { Keyboard.press(KEY_RIGHT_SHIFT); } else { Keyboard.release(KEY_RIGHT_SHIFT); } 270 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_GUI); } else { Keyboard.release(KEY_RIGHT_GUI); } 271 digitalWrite(c11, HIGH); 272 273 digitalWrite(c12, LOW); 274 if ((digitalRead(r2) == 0) or (digitalRead(r3) == 0)) 275 digitalWrite(c12, HIGH); 276 277 digitalWrite(c13, LOW); 278 if (digitalRead(r0) == 0) { Keyboard.press(KEY_BACKSPACE); } else { Keyboard.release(KEY_BACKSPACE); } 279 if (digitalRead(r1) == 0) { Keyboard.press(KEY_RETURN); } else { Keyboard.release(KEY_RETURN); } 280 if (digitalRead(r2) == 0) { 281 if ((layer == 0) or (layer == 2)) Keyboard.press ('`'); 282 if (layer == 1) Keyboard.press(92); 283 } else { Keyboard.release(92); Keyboard.release('`'); } // backslash ascii 92 284 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_CTRL); } else { Keyboard.release(KEY_RIGHT_CTRL); } 285 digitalWrite(c13, HIGH); 286} 287
KB49
c_cpp
1#include <Keyboard.h> 2 3const int r0 = 2; 4const int r1 = 3; 5const int r2 = 4; 6const int r3 = 5; 7 8const int c0 = 6; 9const int c1 = 7; 10const int c2 = 8; 11const int c3 = 9; 12const int c4 = 10; 13const int c5 = 11; 14const int c6 = 12; 15const int c7 = 13; 16const int c8 = 14; 17const int c9 = 15; 18const int c10 = 16; 19const int c11 = 17; 20const int c12 = 18; 21const int c13 = 19; 22 23int layer = 0; //which layer of characters. 0 being alpha; 1 being num, mods, f row; 2 being gamr mode (replace wasd with arrows) 24bool modeHold = false; //if you are holding the mode button 25 26void setup() { 27 pinMode(c0, OUTPUT); 28 pinMode(c1, OUTPUT); 29 pinMode(c2, OUTPUT); 30 pinMode(c3, OUTPUT); 31 pinMode(c4, OUTPUT); 32 pinMode(c5, OUTPUT); 33 pinMode(c6, OUTPUT); 34 pinMode(c7, OUTPUT); 35 pinMode(c8, OUTPUT); 36 pinMode(c9, OUTPUT); 37 pinMode(c10, OUTPUT); 38 pinMode(c11, OUTPUT); 39 pinMode(c12, OUTPUT); 40 pinMode(c13, OUTPUT); 41 42 digitalWrite(c0, HIGH); 43 digitalWrite(c1, HIGH); 44 digitalWrite(c2, HIGH); 45 digitalWrite(c3, HIGH); 46 digitalWrite(c4, HIGH); 47 digitalWrite(c5, HIGH); 48 digitalWrite(c6, HIGH); 49 digitalWrite(c7, HIGH); 50 digitalWrite(c8, HIGH); 51 digitalWrite(c9, HIGH); 52 digitalWrite(c10, HIGH); 53 digitalWrite(c11, HIGH); 54 digitalWrite(c12, HIGH); 55 digitalWrite(c13, HIGH); 56 57 pinMode(r0, INPUT_PULLUP); 58 pinMode(r1, INPUT_PULLUP); 59 pinMode(r2, INPUT_PULLUP); 60 pinMode(r3, INPUT_PULLUP); 61 62 Keyboard.begin(); 63 64} 65 66void loop() { 67 68 digitalWrite(c0, LOW); 69 if (digitalRead(r0) == 0) { 70 if ((layer == 0) or (layer == 2)) Keyboard.press(KEY_ESC); 71 if (layer == 1) Keyboard.press(KEY_TAB); 72 } else { Keyboard.release(KEY_ESC); Keyboard.release(KEY_TAB); } 73 if (digitalRead(r1) == 0) { 74 Keyboard.press(KEY_CAPS_LOCK); 75 } else { Keyboard.release(KEY_CAPS_LOCK); } 76 if (digitalRead(r2) == 0) { 77 Keyboard.press(KEY_LEFT_SHIFT); 78 } else { Keyboard.release(KEY_LEFT_SHIFT); } 79 if (digitalRead(r3) == 0) { 80 Keyboard.press(KEY_LEFT_CTRL); 81 } else { Keyboard.release(KEY_LEFT_CTRL); } 82 digitalWrite(c0, HIGH); 83 84 digitalWrite(c1, LOW); 85 if (digitalRead(r0) == 0) { 86 if ((layer == 0) or (layer == 2)) Keyboard.press ('q'); 87 if (layer == 1) Keyboard.press('1'); 88 } else { Keyboard.release('q'); Keyboard.release('1'); } 89 if (digitalRead(r1) == 0) { 90 if (layer == 0) Keyboard.press ('a'); 91 if (layer == 1) Keyboard.press(KEY_F1); 92 if (layer == 2) Keyboard.press(KEY_LEFT_ARROW); 93 } else { Keyboard.release('a'); Keyboard.release(KEY_F1); Keyboard.release(KEY_LEFT_ARROW); } 94 if (digitalRead(r2) == 0) { 95 if ((layer == 0) or (layer == 2)) Keyboard.press ('z'); 96 if (layer == 1) Keyboard.press(KEY_F12); 97 } else { Keyboard.release('z'); Keyboard.release(KEY_F12); } 98 if (digitalRead(r3) == 0) { 99 Keyboard.press(KEY_LEFT_GUI); 100 } else { Keyboard.release(KEY_LEFT_GUI); } 101 digitalWrite(c1, HIGH); 102 103 digitalWrite(c2, LOW); 104 if (digitalRead(r0) == 0) { 105 if (layer == 0) Keyboard.press ('w'); 106 if (layer == 1) Keyboard.press('2'); 107 if (layer == 2) Keyboard.press(KEY_UP_ARROW); 108 } else { Keyboard.release('w'); Keyboard.release('2'); Keyboard.release(KEY_UP_ARROW); } 109 if (digitalRead(r1) == 0) { 110 if (layer == 0) Keyboard.press ('s'); 111 if (layer == 1) Keyboard.press(KEY_F2); 112 if (layer == 2) Keyboard.press(KEY_DOWN_ARROW); 113 } else { Keyboard.release('s'); Keyboard.release(KEY_F2); Keyboard.release(KEY_DOWN_ARROW); } 114 if (digitalRead(r2) == 0) { 115 if ((layer == 0) or (layer == 2)) Keyboard.press ('x'); 116 if (layer == 1) Keyboard.press(KEY_F13); 117 } else { Keyboard.release('x'); Keyboard.release(KEY_F13); } 118 if (digitalRead(r3) == 0) { 119 Keyboard.press(KEY_LEFT_ALT); //operating system 120 } else { Keyboard.release(KEY_LEFT_ALT); } 121 digitalWrite(c2, HIGH); 122 123 digitalWrite(c3, LOW); 124 if (digitalRead(r0) == 0) { 125 if ((layer == 0) or (layer == 2)) Keyboard.press ('e'); 126 if (layer == 1) Keyboard.press('3'); 127 } else { Keyboard.release('e'); Keyboard.release('3'); } 128 if (digitalRead(r1) == 0) { 129 if (layer == 0) Keyboard.press ('d'); 130 if (layer == 1) Keyboard.press(KEY_F3); 131 if (layer == 2) Keyboard.press(KEY_RIGHT_ARROW); 132 } else { Keyboard.release('d'); Keyboard.release(KEY_F3); Keyboard.release(KEY_RIGHT_ARROW); } 133 if (digitalRead(r2) == 0) { 134 if ((layer == 0) or (layer == 2)) Keyboard.press ('c'); 135 if (layer == 1) Keyboard.press(KEY_F14); 136 } else { Keyboard.release('c'); Keyboard.release(KEY_F14); } 137 digitalWrite(c3, HIGH); 138 139 digitalWrite(c4, LOW); 140 if (digitalRead(r0) == 0) { 141 if ((layer == 0) or (layer == 2)) Keyboard.press ('r'); 142 if (layer == 1) Keyboard.press('4'); 143 } else { Keyboard.release('r'); Keyboard.release('4'); } 144 if (digitalRead(r1) == 0) { 145 if ((layer == 0) or (layer == 2)) Keyboard.press ('f'); 146 if (layer == 1) Keyboard.press(KEY_F4); 147 } else { Keyboard.release('f'); Keyboard.release(KEY_F4); } 148 if (digitalRead(r2) == 0) { 149 if ((layer == 0) or (layer == 2)) Keyboard.press ('v'); 150 if (layer == 1) Keyboard.press(KEY_F15); 151 } else { Keyboard.release('v'); Keyboard.release(KEY_F15); } 152 if (digitalRead(r3) == 0) { 153 Keyboard.press(' '); 154 delay(50); 155 } else { Keyboard.release(' '); } 156 digitalWrite(c4, HIGH); 157 158 digitalWrite(c5, LOW); 159 if (digitalRead(r0) == 0) { 160 if ((layer == 0) or (layer == 2)) Keyboard.press ('t'); 161 if (layer == 1) Keyboard.press('5'); 162 } else { Keyboard.release('t'); Keyboard.release('5'); } 163 if (digitalRead(r1) == 0) { 164 if ((layer == 0) or (layer == 2)) Keyboard.press ('g'); 165 if (layer == 1) Keyboard.press(KEY_F5); 166 } else { Keyboard.release('g'); Keyboard.release(KEY_F5); } 167 if (digitalRead(r2) == 0) { 168 if ((layer == 0) or (layer == 2)) Keyboard.press ('b'); 169 if (layer == 1) Keyboard.press(206); 170 } else { Keyboard.release('b'); Keyboard.release(206); } //prntscreen ascii 206 171 digitalWrite(c5, HIGH); 172 173 digitalWrite(c6, LOW); 174 if (digitalRead(r0) == 0) { 175 if ((layer == 0) or (layer == 2)) Keyboard.press ('['); 176 if (layer == 1) Keyboard.press('6'); 177 } else { Keyboard.release('['); Keyboard.release('6'); } 178 if (digitalRead(r1) == 0) { 179 if ((layer == 0) or (layer == 2)) Keyboard.press (';'); 180 if (layer == 1) Keyboard.press(KEY_F6); 181 } else { Keyboard.release(';'); Keyboard.release(KEY_F6); } 182 if (digitalRead(r2) == 0) { 183 if ((layer == 0) or (layer == 2)) Keyboard.press (','); 184 if (layer == 1) Keyboard.press(KEY_INSERT); 185 } else { Keyboard.release(','); Keyboard.release(KEY_INSERT); } 186 if (digitalRead(r3) == 0) { 187 if (modeHold == false) { 188 if (layer == 0) { 189 layer = 1; 190 } else if (layer == 1) { 191 layer = 2; 192 } else if (layer == 2) { layer = 0; } 193 modeHold = true; 194 } 195 } else { modeHold = false; } 196 digitalWrite(c6, HIGH); 197 198 digitalWrite(c7, LOW); 199 if (digitalRead(r0) == 0) { 200 if ((layer == 0) or (layer == 2)) Keyboard.press (']'); 201 if (layer == 1) Keyboard.press('7'); 202 } else { Keyboard.release(']'); Keyboard.release('7'); } 203 if (digitalRead(r1) == 0) { 204 if ((layer == 0) or (layer == 2)) Keyboard.press ('\\''); // \\' meant for ' so more like " ' " 205 if (layer == 1) Keyboard.press(KEY_F7); 206 } else { Keyboard.release('\\''); Keyboard.release(KEY_F7); } 207 if (digitalRead(r2) == 0) { 208 if ((layer == 0) or (layer == 2)) Keyboard.press ('.'); 209 if (layer == 1) Keyboard.press(KEY_HOME); 210 } else { Keyboard.release('.'); Keyboard.release(KEY_HOME); } 211 digitalWrite(c7, HIGH); 212 213 digitalWrite(c8, LOW); 214 if (digitalRead(r0) == 0) { 215 if ((layer == 0) or (layer == 2)) Keyboard.press ('y'); 216 if (layer == 1) Keyboard.press('8'); 217 } else { Keyboard.release('y'); Keyboard.release('8'); } 218 if (digitalRead(r1) == 0) { 219 if ((layer == 0) or (layer == 2)) Keyboard.press ('h'); 220 if (layer == 1) Keyboard.press(KEY_F8); 221 } else { Keyboard.release('h'); Keyboard.release(KEY_F8); } 222 if (digitalRead(r2) == 0) { 223 if ((layer == 0) or (layer == 2)) Keyboard.press ('n'); 224 if (layer == 1) Keyboard.press(KEY_PAGE_UP); 225 } else { Keyboard.release('n'); Keyboard.release(KEY_PAGE_UP); } 226 if (digitalRead(r3) == 0) { Keyboard.press(' '); delay(50); } else { Keyboard.release(' '); } 227 digitalWrite(c8, HIGH); 228 229 digitalWrite(c9, LOW); 230 if (digitalRead(r0) == 0) { 231 if ((layer == 0) or (layer == 2)) Keyboard.press ('u'); 232 if (layer == 1) Keyboard.press('9'); 233 } else { Keyboard.release('u'); Keyboard.release('9'); } 234 if (digitalRead(r1) == 0) { 235 if ((layer == 0) or (layer == 2)) Keyboard.press ('j'); 236 if (layer == 1) Keyboard.press(KEY_F9); 237 } else { Keyboard.release('j'); Keyboard.release(KEY_F9); } 238 if (digitalRead(r2) == 0) { 239 if ((layer == 0) or (layer == 2)) Keyboard.press ('m'); 240 if (layer == 1) Keyboard.press(KEY_PAGE_DOWN); 241 } else { Keyboard.release(KEY_PAGE_DOWN); Keyboard.release('m'); } 242 digitalWrite(c9, HIGH); 243 244 digitalWrite(c10, LOW); 245 if (digitalRead(r0) == 0) { 246 if ((layer == 0) or (layer == 2)) Keyboard.press ('i'); 247 if (layer == 1) Keyboard.press('0'); 248 } else { Keyboard.release('i'); Keyboard.release('0'); } 249 if (digitalRead(r1) == 0) { 250 if ((layer == 0) or (layer == 2)) Keyboard.press ('k'); 251 if (layer == 1) Keyboard.press(KEY_F10); 252 } else { Keyboard.release('k'); Keyboard.release(KEY_F10); } 253 if (digitalRead(r2) == 0) { 254 if ((layer == 0) or (layer == 2)) Keyboard.press ('/'); 255 if (layer == 1) Keyboard.press(KEY_END); 256 } else { Keyboard.release(KEY_END); Keyboard.release('/'); } 257 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_ALT); } else { Keyboard.release(KEY_RIGHT_ALT); } 258 digitalWrite(c10, HIGH); 259 260 digitalWrite(c11, LOW); 261 if (digitalRead(r0) == 0) { 262 if ((layer == 0) or (layer == 2)) Keyboard.press ('o'); 263 if (layer == 1) Keyboard.press('-'); 264 } else { Keyboard.release('-'); Keyboard.release('o'); } 265 if (digitalRead(r1) == 0) { 266 if ((layer == 0) or (layer == 2)) Keyboard.press ('l'); 267 if (layer == 1) Keyboard.press(KEY_F11); 268 } else { Keyboard.release('l'); Keyboard.release(KEY_F11); }//start A circut 269 if (digitalRead(r2) == 0) { Keyboard.press(KEY_RIGHT_SHIFT); } else { Keyboard.release(KEY_RIGHT_SHIFT); } 270 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_GUI); } else { Keyboard.release(KEY_RIGHT_GUI); } 271 digitalWrite(c11, HIGH); 272 273 digitalWrite(c12, LOW); 274 if ((digitalRead(r2) == 0) or (digitalRead(r3) == 0)) { 275 if ((layer == 0) or (layer == 2)) Keyboard.press('p'); 276 if (layer == 1) Keyboard.press('='); 277 } else { Keyboard.release('p'); Keyboard.release('='); } 278 digitalWrite(c12, HIGH); 279 280 digitalWrite(c13, LOW); 281 if (digitalRead(r0) == 0) { Keyboard.press(KEY_BACKSPACE); } else { Keyboard.release(KEY_BACKSPACE); } 282 if (digitalRead(r1) == 0) { Keyboard.press(KEY_RETURN); } else { Keyboard.release(KEY_RETURN); } 283 if (digitalRead(r2) == 0) { 284 if ((layer == 0) or (layer == 2)) Keyboard.press ('`'); 285 if (layer == 1) Keyboard.press(92); 286 } else { Keyboard.release(92); Keyboard.release('`'); } // backslash ascii 92 287 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_CTRL); } else { Keyboard.release(KEY_RIGHT_CTRL); } 288 digitalWrite(c13, HIGH); 289} 290
KB49
c_cpp
1#include <Keyboard.h> 2 3const int r0 = 2; 4const int r1 = 3; 5const int r2 = 4; 6const int r3 = 5; 7 8const int c0 = 6; 9const int c1 = 7; 10const int c2 = 8; 11const int c3 = 9; 12const int c4 = 10; 13const int c5 = 11; 14const int c6 = 12; 15const int c7 = 13; 16const int c8 = 14; 17const int c9 = 15; 18const int c10 = 16; 19const int c11 = 17; 20const int c12 = 18; 21const int c13 = 19; 22 23int layer = 0; //which layer of characters. 0 being alpha; 1 being num, mods, f row; 2 being gamr mode (replace wasd with arrows) 24bool modeHold = false; //if you are holding the mode button 25 26void setup() { 27 pinMode(c0, OUTPUT); 28 pinMode(c1, OUTPUT); 29 pinMode(c2, OUTPUT); 30 pinMode(c3, OUTPUT); 31 pinMode(c4, OUTPUT); 32 pinMode(c5, OUTPUT); 33 pinMode(c6, OUTPUT); 34 pinMode(c7, OUTPUT); 35 pinMode(c8, OUTPUT); 36 pinMode(c9, OUTPUT); 37 pinMode(c10, OUTPUT); 38 pinMode(c11, OUTPUT); 39 pinMode(c12, OUTPUT); 40 pinMode(c13, OUTPUT); 41 42 digitalWrite(c0, HIGH); 43 digitalWrite(c1, HIGH); 44 digitalWrite(c2, HIGH); 45 digitalWrite(c3, HIGH); 46 digitalWrite(c4, HIGH); 47 digitalWrite(c5, HIGH); 48 digitalWrite(c6, HIGH); 49 digitalWrite(c7, HIGH); 50 digitalWrite(c8, HIGH); 51 digitalWrite(c9, HIGH); 52 digitalWrite(c10, HIGH); 53 digitalWrite(c11, HIGH); 54 digitalWrite(c12, HIGH); 55 digitalWrite(c13, HIGH); 56 57 pinMode(r0, INPUT_PULLUP); 58 pinMode(r1, INPUT_PULLUP); 59 pinMode(r2, INPUT_PULLUP); 60 pinMode(r3, INPUT_PULLUP); 61 62 Keyboard.begin(); 63 64} 65 66void loop() { 67 68 digitalWrite(c0, LOW); 69 if (digitalRead(r0) == 0) { 70 if ((layer == 0) or (layer == 2)) Keyboard.press(KEY_ESC); 71 if (layer == 1) Keyboard.press(KEY_TAB); 72 } else { Keyboard.release(KEY_ESC); Keyboard.release(KEY_TAB); } 73 if (digitalRead(r1) == 0) { 74 Keyboard.press(KEY_CAPS_LOCK); 75 } else { Keyboard.release(KEY_CAPS_LOCK); } 76 if (digitalRead(r2) == 0) { 77 Keyboard.press(KEY_LEFT_SHIFT); 78 } else { Keyboard.release(KEY_LEFT_SHIFT); } 79 if (digitalRead(r3) == 0) { 80 Keyboard.press(KEY_LEFT_CTRL); 81 } else { Keyboard.release(KEY_LEFT_CTRL); } 82 digitalWrite(c0, HIGH); 83 84 digitalWrite(c1, LOW); 85 if (digitalRead(r0) == 0) { 86 if ((layer == 0) or (layer == 2)) Keyboard.press ('q'); 87 if (layer == 1) Keyboard.press('1'); 88 } else { Keyboard.release('q'); Keyboard.release('1'); } 89 if (digitalRead(r1) == 0) { 90 if (layer == 0) Keyboard.press ('a'); 91 if (layer == 1) Keyboard.press(KEY_F1); 92 if (layer == 2) Keyboard.press(KEY_LEFT_ARROW); 93 } else { Keyboard.release('a'); Keyboard.release(KEY_F1); Keyboard.release(KEY_LEFT_ARROW); } 94 if (digitalRead(r2) == 0) { 95 if ((layer == 0) or (layer == 2)) Keyboard.press ('z'); 96 if (layer == 1) Keyboard.press(KEY_F12); 97 } else { Keyboard.release('z'); Keyboard.release(KEY_F12); } 98 if (digitalRead(r3) == 0) { 99 Keyboard.press(KEY_LEFT_GUI); 100 } else { Keyboard.release(KEY_LEFT_GUI); } 101 digitalWrite(c1, HIGH); 102 103 digitalWrite(c2, LOW); 104 if (digitalRead(r0) == 0) { 105 if (layer == 0) Keyboard.press ('w'); 106 if (layer == 1) Keyboard.press('2'); 107 if (layer == 2) Keyboard.press(KEY_UP_ARROW); 108 } else { Keyboard.release('w'); Keyboard.release('2'); Keyboard.release(KEY_UP_ARROW); } 109 if (digitalRead(r1) == 0) { 110 if (layer == 0) Keyboard.press ('s'); 111 if (layer == 1) Keyboard.press(KEY_F2); 112 if (layer == 2) Keyboard.press(KEY_DOWN_ARROW); 113 } else { Keyboard.release('s'); Keyboard.release(KEY_F2); Keyboard.release(KEY_DOWN_ARROW); } 114 if (digitalRead(r2) == 0) { 115 if ((layer == 0) or (layer == 2)) Keyboard.press ('x'); 116 if (layer == 1) Keyboard.press(KEY_F13); 117 } else { Keyboard.release('x'); Keyboard.release(KEY_F13); } 118 if (digitalRead(r3) == 0) { 119 Keyboard.press(KEY_LEFT_ALT); //operating system 120 } else { Keyboard.release(KEY_LEFT_ALT); } 121 digitalWrite(c2, HIGH); 122 123 digitalWrite(c3, LOW); 124 if (digitalRead(r0) == 0) { 125 if ((layer == 0) or (layer == 2)) Keyboard.press ('e'); 126 if (layer == 1) Keyboard.press('3'); 127 } else { Keyboard.release('e'); Keyboard.release('3'); } 128 if (digitalRead(r1) == 0) { 129 if (layer == 0) Keyboard.press ('d'); 130 if (layer == 1) Keyboard.press(KEY_F3); 131 if (layer == 2) Keyboard.press(KEY_RIGHT_ARROW); 132 } else { Keyboard.release('d'); Keyboard.release(KEY_F3); Keyboard.release(KEY_RIGHT_ARROW); } 133 if (digitalRead(r2) == 0) { 134 if ((layer == 0) or (layer == 2)) Keyboard.press ('c'); 135 if (layer == 1) Keyboard.press(KEY_F14); 136 } else { Keyboard.release('c'); Keyboard.release(KEY_F14); } 137 digitalWrite(c3, HIGH); 138 139 digitalWrite(c4, LOW); 140 if (digitalRead(r0) == 0) { 141 if ((layer == 0) or (layer == 2)) Keyboard.press ('r'); 142 if (layer == 1) Keyboard.press('4'); 143 } else { Keyboard.release('r'); Keyboard.release('4'); } 144 if (digitalRead(r1) == 0) { 145 if ((layer == 0) or (layer == 2)) Keyboard.press ('f'); 146 if (layer == 1) Keyboard.press(KEY_F4); 147 } else { Keyboard.release('f'); Keyboard.release(KEY_F4); } 148 if (digitalRead(r2) == 0) { 149 if ((layer == 0) or (layer == 2)) Keyboard.press ('v'); 150 if (layer == 1) Keyboard.press(KEY_F15); 151 } else { Keyboard.release('v'); Keyboard.release(KEY_F15); } 152 if (digitalRead(r3) == 0) { 153 Keyboard.press(' '); 154 delay(50); 155 } else { Keyboard.release(' '); } 156 digitalWrite(c4, HIGH); 157 158 digitalWrite(c5, LOW); 159 if (digitalRead(r0) == 0) { 160 if ((layer == 0) or (layer == 2)) Keyboard.press ('t'); 161 if (layer == 1) Keyboard.press('5'); 162 } else { Keyboard.release('t'); Keyboard.release('5'); } 163 if (digitalRead(r1) == 0) { 164 if ((layer == 0) or (layer == 2)) Keyboard.press ('g'); 165 if (layer == 1) Keyboard.press(KEY_F5); 166 } else { Keyboard.release('g'); Keyboard.release(KEY_F5); } 167 if (digitalRead(r2) == 0) { 168 if ((layer == 0) or (layer == 2)) Keyboard.press ('b'); 169 if (layer == 1) Keyboard.press(206); 170 } else { Keyboard.release('b'); Keyboard.release(206); } //prntscreen ascii 206 171 digitalWrite(c5, HIGH); 172 173 digitalWrite(c6, LOW); 174 if (digitalRead(r0) == 0) { 175 if ((layer == 0) or (layer == 2)) Keyboard.press ('['); 176 if (layer == 1) Keyboard.press('6'); 177 } else { Keyboard.release('['); Keyboard.release('6'); } 178 if (digitalRead(r1) == 0) { 179 if ((layer == 0) or (layer == 2)) Keyboard.press (';'); 180 if (layer == 1) Keyboard.press(KEY_F6); 181 } else { Keyboard.release(';'); Keyboard.release(KEY_F6); } 182 if (digitalRead(r2) == 0) { 183 if ((layer == 0) or (layer == 2)) Keyboard.press (','); 184 if (layer == 1) Keyboard.press(KEY_INSERT); 185 } else { Keyboard.release(','); Keyboard.release(KEY_INSERT); } 186 if (digitalRead(r3) == 0) { 187 if (modeHold == false) { 188 if (layer == 0) { 189 layer = 1; 190 } else if (layer == 1) { 191 layer = 2; 192 } else if (layer == 2) { layer = 0; } 193 modeHold = true; 194 } 195 } else { modeHold = false; } 196 digitalWrite(c6, HIGH); 197 198 digitalWrite(c7, LOW); 199 if (digitalRead(r0) == 0) { 200 if ((layer == 0) or (layer == 2)) Keyboard.press (']'); 201 if (layer == 1) Keyboard.press('7'); 202 } else { Keyboard.release(']'); Keyboard.release('7'); } 203 if (digitalRead(r1) == 0) { 204 if ((layer == 0) or (layer == 2)) Keyboard.press ('\\''); // \\' meant for ' so more like " ' " 205 if (layer == 1) Keyboard.press(KEY_F7); 206 } else { Keyboard.release('\\''); Keyboard.release(KEY_F7); } 207 if (digitalRead(r2) == 0) { 208 if ((layer == 0) or (layer == 2)) Keyboard.press ('.'); 209 if (layer == 1) Keyboard.press(KEY_HOME); 210 } else { Keyboard.release('.'); Keyboard.release(KEY_HOME); } 211 digitalWrite(c7, HIGH); 212 213 digitalWrite(c8, LOW); 214 if (digitalRead(r0) == 0) { 215 if ((layer == 0) or (layer == 2)) Keyboard.press ('y'); 216 if (layer == 1) Keyboard.press('8'); 217 } else { Keyboard.release('y'); Keyboard.release('8'); } 218 if (digitalRead(r1) == 0) { 219 if ((layer == 0) or (layer == 2)) Keyboard.press ('h'); 220 if (layer == 1) Keyboard.press(KEY_F8); 221 } else { Keyboard.release('h'); Keyboard.release(KEY_F8); } 222 if (digitalRead(r2) == 0) { 223 if ((layer == 0) or (layer == 2)) Keyboard.press ('n'); 224 if (layer == 1) Keyboard.press(KEY_PAGE_UP); 225 } else { Keyboard.release('n'); Keyboard.release(KEY_PAGE_UP); } 226 if (digitalRead(r3) == 0) { Keyboard.press(' '); delay(50); } else { Keyboard.release(' '); } 227 digitalWrite(c8, HIGH); 228 229 digitalWrite(c9, LOW); 230 if (digitalRead(r0) == 0) { 231 if ((layer == 0) or (layer == 2)) Keyboard.press ('u'); 232 if (layer == 1) Keyboard.press('9'); 233 } else { Keyboard.release('u'); Keyboard.release('9'); } 234 if (digitalRead(r1) == 0) { 235 if ((layer == 0) or (layer == 2)) Keyboard.press ('j'); 236 if (layer == 1) Keyboard.press(KEY_F9); 237 } else { Keyboard.release('j'); Keyboard.release(KEY_F9); } 238 if (digitalRead(r2) == 0) { 239 if ((layer == 0) or (layer == 2)) Keyboard.press ('m'); 240 if (layer == 1) Keyboard.press(KEY_PAGE_DOWN); 241 } else { Keyboard.release(KEY_PAGE_DOWN); Keyboard.release('m'); } 242 digitalWrite(c9, HIGH); 243 244 digitalWrite(c10, LOW); 245 if (digitalRead(r0) == 0) { 246 if ((layer == 0) or (layer == 2)) Keyboard.press ('i'); 247 if (layer == 1) Keyboard.press('0'); 248 } else { Keyboard.release('i'); Keyboard.release('0'); } 249 if (digitalRead(r1) == 0) { 250 if ((layer == 0) or (layer == 2)) Keyboard.press ('k'); 251 if (layer == 1) Keyboard.press(KEY_F10); 252 } else { Keyboard.release('k'); Keyboard.release(KEY_F10); } 253 if (digitalRead(r2) == 0) { 254 if ((layer == 0) or (layer == 2)) Keyboard.press ('/'); 255 if (layer == 1) Keyboard.press(KEY_END); 256 } else { Keyboard.release(KEY_END); Keyboard.release('/'); } 257 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_ALT); } else { Keyboard.release(KEY_RIGHT_ALT); } 258 digitalWrite(c10, HIGH); 259 260 digitalWrite(c11, LOW); 261 if (digitalRead(r0) == 0) { 262 if ((layer == 0) or (layer == 2)) Keyboard.press ('o'); 263 if (layer == 1) Keyboard.press('-'); 264 } else { Keyboard.release('-'); Keyboard.release('o'); } 265 if (digitalRead(r1) == 0) { 266 if ((layer == 0) or (layer == 2)) Keyboard.press ('l'); 267 if (layer == 1) Keyboard.press(KEY_F11); 268 } else { Keyboard.release('l'); Keyboard.release(KEY_F11); }//start A circut 269 if (digitalRead(r2) == 0) { Keyboard.press(KEY_RIGHT_SHIFT); } else { Keyboard.release(KEY_RIGHT_SHIFT); } 270 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_GUI); } else { Keyboard.release(KEY_RIGHT_GUI); } 271 digitalWrite(c11, HIGH); 272 273 digitalWrite(c12, LOW); 274 if ((digitalRead(r2) == 0) or (digitalRead(r3) == 0)) { 275 if ((layer == 0) or (layer == 2)) Keyboard.press('p'); 276 if (layer == 1) Keyboard.press('='); 277 } else { Keyboard.release('p'); Keyboard.release('='); } 278 digitalWrite(c12, HIGH); 279 280 digitalWrite(c13, LOW); 281 if (digitalRead(r0) == 0) { Keyboard.press(KEY_BACKSPACE); } else { Keyboard.release(KEY_BACKSPACE); } 282 if (digitalRead(r1) == 0) { Keyboard.press(KEY_RETURN); } else { Keyboard.release(KEY_RETURN); } 283 if (digitalRead(r2) == 0) { 284 if ((layer == 0) or (layer == 2)) Keyboard.press ('`'); 285 if (layer == 1) Keyboard.press(92); 286 } else { Keyboard.release(92); Keyboard.release('`'); } // backslash ascii 92 287 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_CTRL); } else { Keyboard.release(KEY_RIGHT_CTRL); } 288 digitalWrite(c13, HIGH); 289} 290
49KB.ino
c_cpp
The C++ File for the Arduino/PCB.
1#include <Keyboard.h> 2 3const int r0 = 2; 4const int r1 = 3; 5const int r2 = 4; 6const int r3 = 5; 7 8const int c0 = 6; 9const int c1 = 7; 10const int c2 = 8; 11const int c3 = 9; 12const int c4 = 10; 13const int c5 = 11; 14const int c6 = 12; 15const int c7 = 13; 16const int c8 = 14; 17const int c9 = 15; 18const int c10 = 16; 19const int c11 = 17; 20const int c12 = 18; 21const int c13 = 19; 22 23int layer = 0; //which layer of characters. 0 being alpha; 1 being num, mods, f row; 2 being gamr mode (replace wasd with arrows) 24bool modeHold = false; //if you are holding the mode button 25 26void setup() { 27 pinMode(c0, OUTPUT); 28 pinMode(c1, OUTPUT); 29 pinMode(c2, OUTPUT); 30 pinMode(c3, OUTPUT); 31 pinMode(c4, OUTPUT); 32 pinMode(c5, OUTPUT); 33 pinMode(c6, OUTPUT); 34 pinMode(c7, OUTPUT); 35 pinMode(c8, OUTPUT); 36 pinMode(c9, OUTPUT); 37 pinMode(c10, OUTPUT); 38 pinMode(c11, OUTPUT); 39 pinMode(c12, OUTPUT); 40 pinMode(c13, OUTPUT); 41 42 digitalWrite(c0, HIGH); 43 digitalWrite(c1, HIGH); 44 digitalWrite(c2, HIGH); 45 digitalWrite(c3, HIGH); 46 digitalWrite(c4, HIGH); 47 digitalWrite(c5, HIGH); 48 digitalWrite(c6, HIGH); 49 digitalWrite(c7, HIGH); 50 digitalWrite(c8, HIGH); 51 digitalWrite(c9, HIGH); 52 digitalWrite(c10, HIGH); 53 digitalWrite(c11, HIGH); 54 digitalWrite(c12, HIGH); 55 digitalWrite(c13, HIGH); 56 57 pinMode(r0, INPUT_PULLUP); 58 pinMode(r1, INPUT_PULLUP); 59 pinMode(r2, INPUT_PULLUP); 60 pinMode(r3, INPUT_PULLUP); 61 62 Keyboard.begin(); 63 64} 65 66void loop() { 67 68 digitalWrite(c0, LOW); 69 if (digitalRead(r0) == 0) { 70 if ((layer == 0) or (layer == 2)) Keyboard.press(KEY_ESC); 71 if (layer == 1) Keyboard.press(KEY_TAB); 72 } else { Keyboard.release(KEY_ESC); Keyboard.release(KEY_TAB); } 73 if (digitalRead(r1) == 0) { 74 Keyboard.press(KEY_CAPS_LOCK); 75 } else { Keyboard.release(KEY_CAPS_LOCK); } 76 if (digitalRead(r2) == 0) { 77 Keyboard.press(KEY_LEFT_SHIFT); 78 } else { Keyboard.release(KEY_LEFT_SHIFT); } 79 if (digitalRead(r3) == 0) { 80 Keyboard.press(KEY_LEFT_CTRL); 81 } else { Keyboard.release(KEY_LEFT_CTRL); } 82 digitalWrite(c0, HIGH); 83 84 digitalWrite(c1, LOW); 85 if (digitalRead(r0) == 0) { 86 if ((layer == 0) or (layer == 2)) Keyboard.press ('q'); 87 if (layer == 1) Keyboard.press('1'); 88 } else { Keyboard.release('q'); Keyboard.release('1'); } 89 if (digitalRead(r1) == 0) { 90 if (layer == 0) Keyboard.press ('a'); 91 if (layer == 1) Keyboard.press(KEY_F1); 92 if (layer == 2) Keyboard.press(KEY_LEFT_ARROW); 93 } else { Keyboard.release('a'); Keyboard.release(KEY_F1); Keyboard.release(KEY_LEFT_ARROW); } 94 if (digitalRead(r2) == 0) { 95 if ((layer == 0) or (layer == 2)) Keyboard.press ('z'); 96 if (layer == 1) Keyboard.press(KEY_F12); 97 } else { Keyboard.release('z'); Keyboard.release(KEY_F12); } 98 if (digitalRead(r3) == 0) { 99 Keyboard.press(KEY_LEFT_GUI); 100 } else { Keyboard.release(KEY_LEFT_GUI); } 101 digitalWrite(c1, HIGH); 102 103 digitalWrite(c2, LOW); 104 if (digitalRead(r0) == 0) { 105 if (layer == 0) Keyboard.press ('w'); 106 if (layer == 1) Keyboard.press('2'); 107 if (layer == 2) Keyboard.press(KEY_UP_ARROW); 108 } else { Keyboard.release('w'); Keyboard.release('2'); Keyboard.release(KEY_UP_ARROW); } 109 if (digitalRead(r1) == 0) { 110 if (layer == 0) Keyboard.press ('s'); 111 if (layer == 1) Keyboard.press(KEY_F2); 112 if (layer == 2) Keyboard.press(KEY_DOWN_ARROW); 113 } else { Keyboard.release('a'); Keyboard.release(KEY_F2); Keyboard.release(KEY_DOWN_ARROW); } 114 if (digitalRead(r2) == 0) { 115 if ((layer == 0) or (layer == 2)) Keyboard.press ('x'); 116 if (layer == 1) Keyboard.press(KEY_F13); 117 } else { Keyboard.release('x'); Keyboard.release(KEY_F13); } 118 if (digitalRead(r3) == 0) { 119 Keyboard.press(KEY_LEFT_ALT); //operating system 120 } else { Keyboard.release(KEY_LEFT_ALT); } 121 digitalWrite(c2, HIGH); 122 123 digitalWrite(c3, LOW); 124 if (digitalRead(r0) == 0) { 125 if ((layer == 0) or (layer == 2)) Keyboard.press ('e'); 126 if (layer == 1) Keyboard.press('3'); 127 } else { Keyboard.release('e'); Keyboard.release('3'); } 128 if (digitalRead(r1) == 0) { 129 if (layer == 0) Keyboard.press ('d'); 130 if (layer == 1) Keyboard.press(KEY_F3); 131 if (layer == 2) Keyboard.press(KEY_RIGHT_ARROW); 132 } else { Keyboard.release('d'); Keyboard.release(KEY_F3); Keyboard.release(KEY_RIGHT_ARROW); } 133 digitalWrite(c3, LOW); 134 if (digitalRead(r0) == 0) { 135 if ((layer == 0) or (layer == 2)) Keyboard.press ('c'); 136 if (layer == 1) Keyboard.press(KEY_F14); 137 } else { Keyboard.release('c'); Keyboard.release(KEY_F14); } 138 digitalWrite(c3, HIGH); 139 140 digitalWrite(c4, LOW); 141 if (digitalRead(r0) == 0) { 142 if ((layer == 0) or (layer == 2)) Keyboard.press ('r'); 143 if (layer == 1) Keyboard.press('4'); 144 } else { Keyboard.release('r'); Keyboard.release('4'); } 145 if (digitalRead(r1) == 0) { 146 if ((layer == 0) or (layer == 2)) Keyboard.press ('f'); 147 if (layer == 1) Keyboard.press(KEY_F4); 148 } else { Keyboard.release('f'); Keyboard.release(KEY_F4); } 149 if (digitalRead(r0) == 0) { 150 if ((layer == 0) or (layer == 2)) Keyboard.press ('v'); 151 if (layer == 1) Keyboard.press(KEY_F15); 152 } else { Keyboard.release('v'); Keyboard.release(KEY_F15); } 153 if (digitalRead(r3) == 0) { 154 Keyboard.press(' '); 155 } else { Keyboard.release(' '); } 156 digitalWrite(c4, HIGH); 157 158 digitalWrite(c5, LOW); 159 if (digitalRead(r0) == 0) { 160 if ((layer == 0) or (layer == 2)) Keyboard.press ('t'); 161 if (layer == 1) Keyboard.press('5'); 162 } else { Keyboard.release('t'); Keyboard.release('5'); } 163 if (digitalRead(r1) == 0) { 164 if ((layer == 0) or (layer == 2)) Keyboard.press ('g'); 165 if (layer == 1) Keyboard.press(KEY_F5); 166 } else { Keyboard.release('g'); Keyboard.release(KEY_F5); } 167 if (digitalRead(r2) == 0) { 168 if ((layer == 0) or (layer == 2)) Keyboard.press ('b'); 169 if (layer == 1) Keyboard.press(206); 170 } else { Keyboard.release('b'); Keyboard.release(206); } //prntscreen ascii 206 171 digitalWrite(c5, HIGH); 172 173 digitalWrite(c6, LOW); 174 if (digitalRead(r0) == 0) { 175 if ((layer == 0) or (layer == 2)) Keyboard.press ('['); 176 if (layer == 1) Keyboard.press('6'); 177 } else { Keyboard.release('['); Keyboard.release('6'); } 178 if (digitalRead(r1) == 0) { 179 if ((layer == 0) or (layer == 2)) Keyboard.press (';'); 180 if (layer == 1) Keyboard.press(KEY_F6); 181 } else { Keyboard.release(';'); Keyboard.release(KEY_F6); } 182 if (digitalRead(r2) == 0) { 183 if ((layer == 0) or (layer == 2)) Keyboard.press (','); 184 if (layer == 1) Keyboard.press(KEY_INSERT); 185 } else { Keyboard.release(','); Keyboard.release(KEY_INSERT); } 186 if (digitalRead(r3) == 0) { 187 if (modeHold == false) { 188 if (layer == 0) { 189 layer = 1; 190 } else if (layer == 1) { 191 layer = 2; 192 } else if (layer == 2) { layer = 0; } 193 modeHold = true; 194 } 195 } else { modeHold = false; } 196 digitalWrite(c6, HIGH); 197 198 digitalWrite(c7, LOW); 199 if (digitalRead(r0) == 0) { 200 if ((layer == 0) or (layer == 2)) Keyboard.press (']'); 201 if (layer == 1) Keyboard.press('7'); 202 } else { Keyboard.release(']'); Keyboard.release('7'); } 203 if (digitalRead(r1) == 0) { 204 if ((layer == 0) or (layer == 2)) Keyboard.press ('\\''); // \\' meant for ' so more like " ' " 205 if (layer == 1) Keyboard.press(KEY_F7); 206 } else { Keyboard.release('\\''); Keyboard.release(KEY_F7); } 207 if (digitalRead(r2) == 0) { 208 if ((layer == 0) or (layer == 2)) Keyboard.press ('.'); 209 if (layer == 1) Keyboard.press(KEY_HOME); 210 } else { Keyboard.release('.'); Keyboard.release(KEY_HOME); } 211 digitalWrite(c7, HIGH); 212 213 digitalWrite(c8, LOW); 214 if (digitalRead(r0) == 0) { 215 if ((layer == 0) or (layer == 2)) Keyboard.press ('y'); 216 if (layer == 1) Keyboard.press('8'); 217 } else { Keyboard.release('y'); Keyboard.release('8'); } 218 if (digitalRead(r1) == 0) { 219 if ((layer == 0) or (layer == 2)) Keyboard.press ('h'); 220 if (layer == 1) Keyboard.press(KEY_F8); 221 } else { Keyboard.release('h'); Keyboard.release(KEY_F8); } 222 if (digitalRead(r2) == 0) { 223 if ((layer == 0) or (layer == 2)) Keyboard.press ('n'); 224 if (layer == 1) Keyboard.press(KEY_PAGE_UP); 225 } else { Keyboard.release('n'); Keyboard.release(KEY_PAGE_UP); } 226 if (digitalRead(r2) == 0) { Keyboard.press(' '); } else { Keyboard.release(' '); } 227 digitalWrite(c8, HIGH); 228 229 digitalWrite(c9, LOW); 230 if (digitalRead(r0) == 0) { 231 if ((layer == 0) or (layer == 2)) Keyboard.press ('u'); 232 if (layer == 1) Keyboard.press('9'); 233 } else { Keyboard.release('u'); Keyboard.release('9'); } 234 if (digitalRead(r1) == 0) { 235 if ((layer == 0) or (layer == 2)) Keyboard.press ('j'); 236 if (layer == 1) Keyboard.press(KEY_F9); 237 } else { Keyboard.release('j'); Keyboard.release(KEY_F9); } 238 if (digitalRead(r2) == 0) { 239 if ((layer == 0) or (layer == 2)) Keyboard.press ('m'); 240 if (layer == 1) Keyboard.press(KEY_PAGE_DOWN); 241 } else { Keyboard.release(KEY_PAGE_DOWN); Keyboard.release('m'); } 242 digitalWrite(c9, HIGH); 243 244 digitalWrite(c10, LOW); 245 if (digitalRead(r0) == 0) { 246 if ((layer == 0) or (layer == 2)) Keyboard.press ('i'); 247 if (layer == 1) Keyboard.press('0'); 248 } else { Keyboard.release('i'); Keyboard.release('0'); } 249 if (digitalRead(r1) == 0) { 250 if ((layer == 0) or (layer == 2)) Keyboard.press ('k'); 251 if (layer == 1) Keyboard.press(KEY_F10); 252 } else { Keyboard.release('k'); Keyboard.release(KEY_F10); } 253 if (digitalRead(r2) == 0) { 254 if ((layer == 0) or (layer == 2)) Keyboard.press ('/'); 255 if (layer == 1) Keyboard.press(KEY_END); 256 } else { Keyboard.release(KEY_END); Keyboard.release('/'); } 257 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_ALT); } else { Keyboard.release(KEY_RIGHT_ALT); } 258 digitalWrite(c10, HIGH); 259 260 digitalWrite(c11, LOW); 261 if (digitalRead(r0) == 0) { 262 if ((layer == 0) or (layer == 2)) Keyboard.press ('o'); 263 if (layer == 1) Keyboard.press('-'); 264 } else { Keyboard.release('-'); Keyboard.release('o'); } 265 if (digitalRead(r1) == 0) { 266 if ((layer == 0) or (layer == 2)) Keyboard.press ('l'); 267 if (layer == 1) Keyboard.press(KEY_F11); 268 } else { Keyboard.release('l'); Keyboard.release(KEY_F11); }//start A circut 269 if (digitalRead(r2) == 0) { Keyboard.press(KEY_RIGHT_SHIFT); } else { Keyboard.release(KEY_RIGHT_SHIFT); } 270 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_GUI); } else { Keyboard.release(KEY_RIGHT_GUI); } 271 digitalWrite(c11, HIGH); 272 273 digitalWrite(c12, LOW); 274 if ((digitalRead(r2) == 0) or (digitalRead(r3) == 0)) 275 digitalWrite(c12, HIGH); 276 277 digitalWrite(c13, LOW); 278 if (digitalRead(r0) == 0) { Keyboard.press(KEY_BACKSPACE); } else { Keyboard.release(KEY_BACKSPACE); } 279 if (digitalRead(r1) == 0) { Keyboard.press(KEY_RETURN); } else { Keyboard.release(KEY_RETURN); } 280 if (digitalRead(r2) == 0) { 281 if ((layer == 0) or (layer == 2)) Keyboard.press ('`'); 282 if (layer == 1) Keyboard.press(92); 283 } else { Keyboard.release(92); Keyboard.release('`'); } // backslash ascii 92 284 if (digitalRead(r3) == 0) { Keyboard.press(KEY_RIGHT_CTRL); } else { Keyboard.release(KEY_RIGHT_CTRL); } 285 digitalWrite(c13, HIGH); 286} 287
Downloadable files
Schematic
Schematic
Gerber file
Gerber file
Gerber file
Gerber file
Schematic
Schematic
Documentation
2_9bxNJoYq8s.stl
2_9bxNJoYq8s.stl
3_ewXLUtYG5v.stl
3_ewXLUtYG5v.stl
3d printed parts
part one of four. the first two are the case, the third and fourth are wrist rest.
3d printed parts
3_ewXLUtYG5v.stl
3_ewXLUtYG5v.stl
3d printed parts
part one of four. the first two are the case, the third and fourth are wrist rest.
3d printed parts
4_IDz9uQeXyP.stl
4_IDz9uQeXyP.stl
2_9bxNJoYq8s.stl
2_9bxNJoYq8s.stl
Comments
Only logged in users can leave comments