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

CircuitPythonで動く自作キーボードの紹介 / Introducing Self-Made Keyboard from CircuitPython

6a87c9bfc71c805c3f5f248b359365d3?s=47 mu2in
September 11, 2021

CircuitPythonで動く自作キーボードの紹介 / Introducing Self-Made Keyboard from CircuitPython

昨年は広島で CircuitPython で自作キーボードを作った話をしました。今回は CircuitPython の KMK Firmware を使った本格自作キーボードを紹介します。

「Python Charity Talks in Japan 2021.09」での登壇資料です。 https://pyconjp.connpass.com/event/218154/

6a87c9bfc71c805c3f5f248b359365d3?s=128

mu2in

September 11, 2021
Tweet

Transcript

  1. CircuitPythonͰಈ͘ ࣗ࡞ΩʔϘʔυͷ঺հ Python Charity Talks in Japan 2021.09 @mu2in

  2. ͓લ୭Α • @mu2in • JavaΤϯδχΞ ˠ JavaScriptΤϯδχΞ • ओͳίϛϡχςΟ׆ಈ ◦

    ͍͢͝޿ౡ ▪ ຖिਫ༵೔ʹ޿ౡͰ։࠵͍ͯ͠ΔIT΋͘΋͘ձ ▪ 2017೥4݄͔Βຖ݄ʮ͍͢͝޿ౡ with PythonʯΛڞಉओ࠵ ◦ PyCon mini Hiroshima ▪ 2018೥10݄͔Βελοϑͱͯ͠ࢀՃ ◦ PyCon JP ▪ ͍͢͝޿ౡ with Python ίϛϡχςΟϒʔεग़ల ▪ PyCon JP 2021: ޿ౡʹ͓͚Δ஍ҬPythonίϛϡχςΟͷ্ཱͪ͛ํͱଓ͚ํ
  3. ͜Ε·Ͱͷ͋Β͢͡ • PyCon mini Hiroshima 2020 Ͱ ࣗ࡞ΩʔϘʔυʹೖ໳͠·ͨ͠ɻ https://speakerdeck.com/mu2in/introduction-to-self-made-keyboard-from-python

  4. ΋ͬͱ؆୯ʹ Python Ͱ ࣗ࡞ΩʔϘʔυΛ࡞Γ͍ͨ

  5. ࠓ೔࿩͢͜ͱ • ࢢൢͷΩʔϘʔυΩοτΛ࢖ͬͯɺ؆୯ʹࣗ࡞ΩʔϘʔυΛ૊ΈཱͯΔ • CircuitPython ͱ KMK Firmware Λ࢖ͬͨࣗ࡞ΩʔϘʔυϓϩάϥϛϯά

  6. ༻ҙ͢Δ΋ͷ • ͸Μͩͯ͝ • ͸Μͩ ܭ3,500ԁ PiPi Gherkin Raspberry Pi

    Pico ΩʔεΠον x30 ϐϯϔομ x2 μΠΦʔυ x30 PCBιέοτ x30 ΩʔΩϟοϓ x30
  7. ૊Έཱͯޙ • ༻ҙͨ͠෦඼Λ͸Μͩ෇͚͠ɺεΠονͱΩʔΩϟοϓΛࠩ͠ࠐΉɻ

  8. ϓϩάϥϛϯάฤ

  9. Raspberry Pi Pico ʹ CircuitPython ΛΠϯετʔϧ • ϦηοτϘλϯ௕ԡ͠ͰUSBέʔϒϧΛ઀ଓ͢ΔͱɺRPI-RP2 υϥΠϒ͕Ϛ΢ϯτ͞ΕΔɻ •

    CircuitPython ͷ UF2ϑΝΠϧΛυϥοά&υϩοϓ͢Δɻ
  10. CircuitPython ʹ KMK Firmware ϥΠϒϥϦΛೖΕΔ • ϚΠίϯΛUSBͰ઀ଓ͠௚͢ͱɺCIRCUITPY υϥΠϒ͕Ϛ΢ϯτ͞ΕΔɻ • libσΟϨΫτϦ഑Լʹ

    KMK Firmware ͷϥΠϒϥϦΛ഑ஔ͢Δɻ • code.py Λฤू͢ΔͱɺϚΠίϯ্Ͱ CircuitPython Λ࣮ߦ͢Δ͜ͱ͕Ͱ͖Δɻ
  11. αϯϓϧΛಈ͔ͯ͠ΈΑ͏ Ωʔಉ࢜ͷܨ͕ΓΛࣔ͢ΩʔϚτϦοΫε Ωʔ͕ԡ͞Εͨ࣌ͷڍಈΛࣔ͢ΩʔϚοϓ PiPi GherkinͰ͸KMK Firmware༻ͷαϯϓϧ͕༻ҙ͞Ε͍ͯΔɻ https://git.40percent.club/di0ib/Misc/src/branch/master/PiPi%20Gherkin/

  12. αϯϓϧͷ஫ҙ఺ ͦͷ··ͩͱΤϥʔ͕ग़ΔͷͰɺϞδϡʔϧͷݺͼग़͕͠ඞཁ https://git.40percent.club/di0ib/Misc/src/branch/master/PiPi%20Gherkin/code.py

  13. ৭ʑͳػೳΛࢼͯ͠ΈΑ͏

  14. ΩʔϚοϓʹରԠ͢ΔΩʔೖྗΛઃఆ͠·͢ɻ
 1จࣈͷೖྗ͚ͩ͡Όͳ͘ Ctrl-C ΍ Ctrl-V ͳͲͷ૊Έ߹ΘͤΛར༻Ͱ͖·͢ɻ Ωʔೖྗͷઃఆํ๏ ίϐʔ ϖʔετ

  15. LayersϞδϡʔϧ ෳ਺ͷΩʔϚοϓͷ੾Γସ͕͑Ͱ͖ΔΑ͏ʹͳΓ·͢ɻ ͜ͷϘλϯΛԡͯ͠Δؒ͸ɺ ԼͷΩʔϚοϓʹͳΔ( A→1 )

  16. ௕ԡ͢͠ΔͱShiftɺControlɺAltͳͲͷम০Ωʔͷݺͼग़͠ΛఆٛͰ͖·͢ɻ ModTapϞδϡʔϧ ௕ԡ͢͠ΔͱCtrl ௕ԡ͢͠ΔͱShift

  17. Media Keys֦ுػೳ ϝσΟΞίϯτϩʔϧͷΩʔΛར༻Ͱ͖ΔΑ͏ʹͳΓ·͢ɻ ϛϡʔτ ϘϦϡʔϜૢ࡞

  18. ·ͱΊ • PiPi Gherkin ͱ KMK Firmware Ͱ؆୯ʹࣗ࡞ΩʔϘʔυ͕࡞Εͨɻ • Zoom

    ͷૢ࡞ ΍ Α͘࢖͏ϚΫϩ Λొ࿥͢Δͱศརɻ • ΈΜͳ΋PythonͰࣗ࡞ΩʔϘʔυʹνϟϨϯδ͠Α͏ʂ ˞͜ͷεϥΠυ͸1J1J(IFSLJOͰॻ͖·ͨ͠ɻ