Skip to content

Commit 068c0b6

Browse files
committed
MacroPad helper library initial.
1 parent dd075a7 commit 068c0b6

File tree

8 files changed

+731
-40
lines changed

8 files changed

+731
-40
lines changed

README.rst

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,35 @@ This driver depends on:
3030

3131
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
3232

33+
* `Adafruit's CircuitPython NeoPixel library
34+
<https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel>`_
35+
36+
* `Adafruit's CircuitPython HID library
37+
<https://github.com/adafruit/Adafruit_CircuitPython_HID>`_
38+
39+
* `Adafruit's CircuitPython MIDI library
40+
<https://github.com/adafruit/Adafruit_CircuitPython_MIDI>`_
41+
42+
* `Adafruit's CircuitPython Display Text library
43+
<https://github.com/adafruit/Adafruit_CircuitPython_Display_Text>`_
44+
45+
* `Adafruit's CircuitPython Simple Text Display library
46+
<https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display>`_
47+
48+
* `Adafruit's CircuitPython Debouncer library
49+
<https://github.com/adafruit/Adafruit_CircuitPython_Debouncer>`_
50+
3351
Please ensure all dependencies are available on the CircuitPython filesystem.
3452
This is easily achieved by downloading
3553
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_
3654
or individual libraries can be installed using
3755
`circup <https://github.com/adafruit/circup>`_.
3856

39-
This library is designed to work withe the Adafruit MacroPad RP2040.
40-
41-
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/5100>`_
57+
This library is designed to work withe the Adafruit MacroPad RP2040. Consider
58+
purchasing one from the Adafruit shop:
4259

60+
`Adafruit MacroPad RP2040 Bare Bones <http://www.adafruit.com/products/5100>`_
61+
`Adafruit MacroPad RP2040 Starter Kit <https://www.adafruit.com/product/5128>`_
4362

4463
Installing to a Connected CircuitPython Device with Circup
4564
==========================================================
@@ -66,8 +85,23 @@ Or the following command to update an existing version:
6685
6786
Usage Example
6887
=============
88+
This example prints out the key pressed, the relative position of the rotary encoder and the
89+
state of the rotary encoder switch.
90+
91+
.. code-block:: python
92+
93+
from adafruit_macropad import MacroPad
94+
import time
95+
96+
macropad = MacroPad()
6997
70-
.. todo:: Add a quick, simple example. It and other examples should live in the
98+
while True:
99+
key_event = macropad.keys.events.get()
100+
if key_event and key_event.pressed:
101+
print("Key pressed: {}".format(key_event.key_number))
102+
print("Encoder: {}".format(macropad.encoder))
103+
print("Encoder switch: {}".format(macropad.encoder_switch))
104+
time.sleep(0.4)
71105
72106
Contributing
73107
============

0 commit comments

Comments
 (0)