A helper library for the Adafruit MacroPad RP2040
Project description
Introduction
A helper library for the Adafruit MacroPad RP2040.
Dependencies
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
This library is designed to work withe the Adafruit MacroPad RP2040. Consider purchasing one from the Adafruit shop:
Adafruit MacroPad RP2040 Bare Bones Adafruit MacroPad RP2040 Starter Kit
Installing to a Connected CircuitPython Device with Circup
Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:
pip3 install circup
With circup installed and your CircuitPython device connected use the following command to install:
circup install adafruit_macropad
Or the following command to update an existing version:
circup update
Usage Example
This example prints out the key pressed, the relative position of the rotary encoder and the state of the rotary encoder switch.
from adafruit_macropad import MacroPad
import time
macropad = MacroPad()
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)
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file adafruit-circuitpython-macropad-2.1.5.tar.gz
.
File metadata
- Download URL: adafruit-circuitpython-macropad-2.1.5.tar.gz
- Upload date:
- Size: 123.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e042566c8cc38237af9925117b537046d2e5d35077c872c9010b9dc3e0fb2e32 |
|
MD5 | caa3d404cd6cabef978d521dacd5509e |
|
BLAKE2b-256 | d98d41435f655b535e0be137d830663df53074707b203926c3c2fe611c74d827 |
File details
Details for the file adafruit_circuitpython_macropad-2.1.5-py3-none-any.whl
.
File metadata
- Download URL: adafruit_circuitpython_macropad-2.1.5-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f24de985ec68755962f222357e86fd63240674fdc1fe392a35844d36e921aa |
|
MD5 | 1ea7dae0812d08b05f20e552f853f532 |
|
BLAKE2b-256 | d19a17593b466c9e83b9d87f0624f7bc80055af333829f91965e6f8c97c944ed |