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. &NBDT খࢦʹ଍Ͱର߅ͨ͠࿩ ![LQIJ

  2. &NBDT খࢦʹ଍Ͱର߅ͨ͠࿩ IUUQXXXHBSJOJPSTJUPCFUUFSEFW

  3. খࢦ͕௧͍ͳΒɺ ଍Ͱ౿Ί͹͍͍͡ΌΜ ఱ ࠽ ͔ 

  4. Ϩγϐ ࡐྉ ΤϑΣΫλʔͱ͔ͷϑοτϖμϧ ϞϊϥϧδϟοΫ "SEVJOP6/0 ఍߅ -&% ݸ ݸ ݸ

    ຊ దྔ
  5. ճ࿏Λ࡞Δ

  6. ϓϧμ΢ϯ఍߅

  7. 㱨 ճ࿏ͷσβύλ

  8. 7 7 3 ϓϧμ΢ϯ఍߅

  9. 7 7 0VUQVU 3 ϓϧμ΢ϯ఍߅

  10. 4XJUDI0GG 3 7 7 0VUQVU7

  11. 4XJUDI0O 7 7 0VUQVU 7

  12. ϓϧμ΢ϯ఍߅͕ͳ͍ͱʜ

  13. 4XJUDI0O 7 7 0VUQVU 7

  14. 4XJUDI0GG 7 7 0VUQVUʁʁ

  15. 4XJUDI0GG 3 7 7 0VUQVU7

  16. ϑοτϖμϧΛͭͳ͙

  17. ϑοτϖμϧͷΠϯλʔϑΣʔε

  18. None
  19. (/% 0VUQVU

  20. 0VUQVU (/%

  21. 7 7 0VUQVU 3

  22. 7 7 0VUQVU7 3

  23. 7 7 0VUQVU 7

  24. 7 7 0VUQVU 7

  25. None
  26. ϖμϧͷ 0/0''͕औಘͰ͖ͨ

  27. 1$ʹͭͳ͍͗ͨ

  28. ˣ 6 4#

  29. ఻Ոͷๅ౛ "SEVJOP

  30. $ ͬΆ͍ ϓϩάϥϜͰ ϚΠίϯΛ 64#੍ޚͰ͖Δ΍ͭ ˡ ϚΠίϯ "73

  31. ίʔυΛॻ͘

  32. #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; } }
  33. #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; } }
  34. #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; } }
  35. #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; } }
  36. "SEVJOP*%&Ͱ ΫϩείϯύΠϧˍసૹ

  37. None
  38. ׬੒

  39. ͱࢥ͍͖΍

  40. "SEVJOP͸ΩʔϘʔυͱͯ͠ ೝࣝ͞Εͳ͍ ΦοεɺΦϥ EFWUUZ64#

  41. γϦΞϧϙʔτΛ؂ࢹ ͢Δπʔϧॻ͘ʜʁ ͳΜ͔μα͍

  42. "SEVJOPͷϑΝʔϜ ॻ͖׵͑Ε͹͍͍͡ΌΜ ఱ ࠽ ͔ 

  43. "SEVJOPʹ 64#)*%஻ΒͤΔ

  44. λʔήοτ "SEVJOPୈೋͷϚΠίϯ 64#⁵γϦΞϧม׵ˠ

  45. ઌਓ͕͍ͨͷͰഈआ

  46. Arduino を DFU モードに ここをショート

  47. EGVQSPHSBNNFSͰম͘ $ brew install dfu-programmer $ dfu-programmer atmega16u2 erase $

    dfu-programmer atmega16u2 flash Arduino-keyboard-0.3.hex $ dfu-programmer atmega16u2 rest
  48. ׬੒

  49. None
  50. Ͱ

  51. 2&NBDT খࢦ ͸ྑ͘ͳͬͨͷʁ

  52. "ࠨ଍͕௧͍

  53. ·ͱΊ

  54. ·ͱΊ FNVMBUJPOϓϥάΠϯΛೖΕΔͱศར ɾWJNPEFʜϏϧτΠϯ EFQSFDBUFE ɾWJNNPEFʜϏϧτΠϯ ɾWJQFSNPEFʜϏϧτΠϯ ɾFWJMNPEFʜIUUQTHJUIVCDPNFNBDTFWJMFWJM ɾTQBDFNBDT ʜIUUQTHJUIVCDPNTZMCOSTQBDFNBDT ɾHPENPEFʜIUUQTHJUIVCDPNDISJTEPOFHPENPEF

  55. ͪͳΈʹ

  56. ౿Ή $USM[ͱͯ͠ σβΠφʔͷ੮Ͱ͕Μ͹͍ͬͯ·͢

  57. 5IBOLZPV Πϥετ͍Β͢ͱ΍ QJYBCBZ GSJU[JOH