-
-
Save thnikk/4e336c8dbed5c5ef3d875da19c046c49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <HID-Project.h> | |
#include <HID-Settings.h> | |
const byte pins[] = { 2, 3, 7, 9, 10, 11, 12, 4 }; | |
char mapping[] = {"sdfjkl `"}; | |
bool buttonCheck[8]; | |
void setup() { | |
for(byte x=0; x<8; x++) pinMode(pins[x], INPUT_PULLUP); | |
NKROKeyboard.begin(); | |
} | |
void loop() { | |
for(byte x=0; x<8; x++) { | |
if (!digitalRead(pins[x]) && !buttonCheck[x]) { NKROKeyboard.press(mapping[x]); buttonCheck[x] = 1; } | |
if (digitalRead(pins[x]) && buttonCheck[x]) { NKROKeyboard.release(mapping[x]); buttonCheck[x] = 0; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment