Skip to main content

A helper library for the Adafruit MacroPad RP2040

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

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.1.6.tar.gz (123.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file adafruit-circuitpython-macropad-2.1.6.tar.gz.

File metadata

File hashes

Hashes for adafruit-circuitpython-macropad-2.1.6.tar.gz
Algorithm Hash digest
SHA256 a0c6123a194aff907eabfff1b8df143956fa4499942f8eeec92bf142f5560d7b
MD5 efffdeb5a01a97eda473271c144114fe
BLAKE2b-256 a45ff63882a123b8b2f2f54f7292232f7896edb2d1e2d4860d5ec295cbb63132

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adafruit_circuitpython_macropad-2.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 62a9921a3c91ccaf953a24e3d038ccbebbd30a80d554cbc01d08d0845988149b
MD5 bb6340be878c3577bbaabcdba74048c5
BLAKE2b-256 c0bc8f7203b824994612cf793949df49528a54831f014c50b273cc1e095458c5

See more details on using hashes here.

Supported by

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