#define PIN_UP 0
#define PIN_DN 1
#define PIN_ENTER 2
#define KEY_UP 0x52
#define KEY_DN 0x51
#define KEY_ENTER 0x28
void setup() {
// put your setup code here, to run once:
pinMode( PIN_UP, INPUT );
pinMode( PIN_DN, INPUT );
pinMode( PIN_ENTER, INPUT );
}
void loop() {
// put your main code here, to run repeatedly:
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.update();
if (digitalRead( PIN_UP ) == LOW) {
DigiKeyboard.sendKeyStroke( KEY_UP );
}
if (digitalRead( PIN_DN ) == LOW) {
DigiKeyboard.sendKeyStroke( KEY_DN );
}
if (digitalRead( PIN_ENTER ) == LOW) {
DigiKeyboard.sendKeyStroke( KEY_ENTER );
}
DigiKeyboard.delay(100);
}
リビングの整理棚を組み立てた April 28, 2024
ワイヤレスイヤホンを修理した April 23, 2024
溶岩腕時計を修理(?)した April 13, 2024
PR
Keyword Search
Comments