Skip to main content

A helper library for the Adafruit MacroPad RP2040

Project description

Introduction

Documentation Status Discord Build Status Code Style: Ruff

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit_circuitpython_macropad-2.4.6.tar.gz (120.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adafruit_circuitpython_macropad-2.4.6-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file adafruit_circuitpython_macropad-2.4.6.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_macropad-2.4.6.tar.gz
Algorithm Hash digest
SHA256 c7525adcee84aecaf00b14efff0d50a293a60dd8c308ecdb77aec487ffeaa705
MD5 eaa6efa41269793d0a80e7473f685a9a
BLAKE2b-256 e257f3019fcf6c9668615163f0f9e9850990b35f8b91dc8d51f8beeb3b479ab4

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_macropad-2.4.6-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_macropad-2.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 73a4d010f4704dee4b35718f9272ce94efa4c42ee6851edb3ea7d3f999aff803
MD5 e4b06039d4b588c1abfc98e8868f1fa9
BLAKE2b-256 109c45e43c6f14769b795bef09d55e4a10c3f99dd354cd59ef72ec9182c58c79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page