code + doc

* First push of the codebase
* Dependencies & hardware documentation
This commit is contained in:
Pierre Guillod 2023-07-27 13:14:23 +02:00
parent 2a1c10b3d3
commit 4eeea5c52d
Signed by: pierre
GPG Key ID: 41B31B007654CC17
2 changed files with 55 additions and 0 deletions

40
MiniKEYS.ino Normal file
View File

@ -0,0 +1,40 @@
#include "Adafruit_NeoKey_1x4.h"
#include "seesaw_neopixel.h"
#include <Keyboard.h>
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);
}
}

View File

@ -1,2 +1,17 @@
# MiniKEYS
4-keyboard featuring <kbd>HOME</kbd>, <kbd>END</kbd>, <kbd>PgUp</kbd> and <kbd>PgDn</kbd> 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_