Skip to content

MacroPad helper library. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,35 @@ This driver depends on:

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

* `Adafruit's CircuitPython NeoPixel library
<https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel>`_

* `Adafruit's CircuitPython HID library
<https://github.com/adafruit/Adafruit_CircuitPython_HID>`_

* `Adafruit's CircuitPython MIDI library
<https://github.com/adafruit/Adafruit_CircuitPython_MIDI>`_

* `Adafruit's CircuitPython Display Text library
<https://github.com/adafruit/Adafruit_CircuitPython_Display_Text>`_

* `Adafruit's CircuitPython Simple Text Display library
<https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display>`_

* `Adafruit's CircuitPython Debouncer library
<https://github.com/adafruit/Adafruit_CircuitPython_Debouncer>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_
or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_.

.. todo:: Describe the Adafruit product this library works with. For PCBs, you can also add the
image from the assets folder in the PCB's GitHub repo.

`Purchase one from the Adafruit shop <http://www.adafruit.com/products/5100>`_
This library is designed to work withe the Adafruit MacroPad RP2040. Consider
purchasing one from the Adafruit shop:

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

Installing to a Connected CircuitPython Device with Circup
==========================================================
Expand All @@ -67,9 +85,23 @@ Or the following command to update an existing version:

Usage Example
=============
This example prints out the key pressed, the relative position of the rotary encoder and the
state of the rotary encoder switch.

.. code-block:: python

from adafruit_macropad import MacroPad
import time

macropad = MacroPad()

.. todo:: Add a quick, simple example. It and other examples should live in the
examples folder and be included in docs/examples.rst.
while True:
key_event = macropad.keys.events.get()
if key_event and key_event.pressed:
print("Key pressed: {}".format(key_event.key_number))
print("Encoder: {}".format(macropad.encoder))
print("Encoder switch: {}".format(macropad.encoder_switch))
time.sleep(0.4)

Contributing
============
Expand Down
Loading