diff --git a/MiniKEYS.ino b/MiniKEYS.ino new file mode 100644 index 0000000..a001005 --- /dev/null +++ b/MiniKEYS.ino @@ -0,0 +1,40 @@ +#include "Adafruit_NeoKey_1x4.h" +#include "seesaw_neopixel.h" +#include + +Adafruit_NeoKey_1x4 neokey; + +void setup() { + Keyboard.begin(); + if (! neokey.begin(0x30)) { + Serial.println("No peripheral detected."); + while(1) delay(10); + } +} + +void loop() { + + uint8_t buttons = neokey.read(); + + if (buttons & (1<<3)) { + Keyboard.press(KEY_HOME); + } else { + Keyboard.release(KEY_HOME); + } + if (buttons & (1<<2)) { + Keyboard.press(KEY_PAGE_UP); + } else { + Keyboard.release(KEY_PAGE_UP); + } + if (buttons & (1<<1)) { + Keyboard.press(KEY_PAGE_DOWN); + } else { + Keyboard.release(KEY_PAGE_DOWN); + } + if (buttons & (1<<0)) { + Keyboard.press(KEY_END); + } else { + Keyboard.release(KEY_END); + } + +} diff --git a/README.md b/README.md index c855f7c..335c44f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ # MiniKEYS +4-keyboard featuring HOME, END, PgUp and PgDn to provide lacking laptops with dedicated keys. + +## Hardware + +Microcontroller Unit (MCU) +: [_Adafruit Trinkey QT2040_](https://adafru.it/5056) (RP2040 chipset) + +Peripheral +: [_NeoKey 1x4 QT I2C_](https://adafru.it/4980) (I2C peripheral) + +## Dependencies + +Libraries will be imported in this repository. In the meantime, please resolve the dependencies manually by installing the following libraries: + +* `Adafruit seesaw Library` by _Adafruit_ \ No newline at end of file