@@ -30,17 +30,35 @@ This driver depends on:
30
30
31
31
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython >`_
32
32
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
+
33
51
Please ensure all dependencies are available on the CircuitPython filesystem.
34
52
This is easily achieved by downloading
35
53
`the Adafruit library and driver bundle <https://circuitpython.org/libraries >`_
36
54
or individual libraries can be installed using
37
55
`circup <https://github.com/adafruit/circup >`_.
38
56
39
- .. todo :: Describe the Adafruit product this library works with. For PCBs, you can also add the
40
- image from the assets folder in the PCB's GitHub repo.
41
-
42
- `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:
43
59
60
+ `Adafruit MacroPad RP2040 Bare Bones <http://www.adafruit.com/products/5100 >`_
61
+ `Adafruit MacroPad RP2040 Starter Kit <https://www.adafruit.com/product/5128 >`_
44
62
45
63
Installing to a Connected CircuitPython Device with Circup
46
64
==========================================================
@@ -67,9 +85,23 @@ Or the following command to update an existing version:
67
85
68
86
Usage Example
69
87
=============
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()
70
97
71
- .. todo :: Add a quick, simple example. It and other examples should live in the
72
- examples folder and be included in docs/examples.rst.
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 )
73
105
74
106
Contributing
75
107
============
0 commit comments