Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[LT] Emacs 小指に足で対抗した話

zk-phi
July 06, 2018

[LT] Emacs 小指に足で対抗した話

社内 LT で自作フットペダルの話をしました。一部ネタはカットしています

zk-phi

July 06, 2018
Tweet

More Decks by zk-phi

Other Decks in Programming

Transcript

  1. #define THRESHOLD 700 uint8_t key_ctrl[8] = { 0, 0, 0xe0,

    0, 0, 0, 0, 0 }; uint8_t key_none[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; void setup () { Serial.begin(9600); } void loop () { static int pressed = 1; int input = analogRead(5); if (pressed && input < THRESHOLD) { Serial.write(key_none, 8); pressed = 0; } else if (!pressed && input1 > THRESHOLD) { Serial.write(key_ctrl, 8); pressed = 1; } }
  2. #define THRESHOLD 700 uint8_t key_ctrl[8] = { 0, 0, 0xe0,

    0, 0, 0, 0, 0 }; uint8_t key_none[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; void setup () { Serial.begin(9600); } void loop () { static int pressed = 1; int input = analogRead(5); if (pressed && input < THRESHOLD) { Serial.write(key_none, 8); pressed = 0; } else if (!pressed && input1 > THRESHOLD) { Serial.write(key_ctrl, 8); pressed = 1; } }
  3. #define THRESHOLD 700 uint8_t key_ctrl[8] = { 0, 0, 0xe0,

    0, 0, 0, 0, 0 }; uint8_t key_none[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; void setup () { Serial.begin(9600); } void loop () { static int pressed = 1; int input = analogRead(5); if (pressed && input < THRESHOLD) { Serial.write(key_none, 8); pressed = 0; } else if (!pressed && input1 > THRESHOLD) { Serial.write(key_ctrl, 8); pressed = 1; } }
  4. #define THRESHOLD 700 uint8_t key_ctrl[8] = { 0, 0, 0xe0,

    0, 0, 0, 0, 0 }; uint8_t key_none[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; void setup () { Serial.begin(9600); } void loop () { static int pressed = 1; int input = analogRead(5); if (pressed && input < THRESHOLD) { Serial.write(key_none, 8); pressed = 0; } else if (!pressed && input1 > THRESHOLD) { Serial.write(key_ctrl, 8); pressed = 1; } }
  5. EGVQSPHSBNNFSͰম͘ $ brew install dfu-programmer $ dfu-programmer atmega16u2 erase $

    dfu-programmer atmega16u2 flash Arduino-keyboard-0.3.hex $ dfu-programmer atmega16u2 rest
  6. Ͱ