MacroPad RP2040 Overview
Introduction
Section titled “Introduction”You can buy MacroPad on the official Adafruit store.
Key Switch Sockets
Section titled “Key Switch Sockets”On the MacroPad, laid out in a 3x4
grid, are the Cherry-MX compatible key switch sockets.
The key switch sockets are individually tied to GPIO pins (i.e. not matrix-wired).
The sockets are available in CircuitPython as board.KEY1
through board.KEY12
.
In Arduino they are pins 1
through 12
.
Pressing a key grounds the pin, so set a pull-up on each pin.
BOOT button
Section titled “BOOT button”On the top right corner of the board (when viewed from the top), there is the rotary encoder: it is the BOOT button. The rotary encode has 20 detents per rotation. The BOOT button is required to enter the bootloader, but it is also available as a user input within code.
The rotary encoder is available at board.ROTA
or board.ENCODER_A
and board.ROTB
or board.ENCODER_B
.
The BOOT button is available at board.ENCODER_SWITCH
or board.BUTTON
.
The rotary encoder is available as PIN_ROTA
and PIN_ROTB
.
The BOOT button is available at PIN_SWITCH
.
Pressing the button grounds the pin.
OLED Display
Section titled “OLED Display”On the top left corner of the board (when viewed from the top), is the 128x64
SH1106 Monochrome OLED display.
NeoPixel LEDs
Section titled “NeoPixel LEDs”Above each set of key switch sockets, are RGB NeoPixel LEDs laid out in the same 3x4
grid.
The NeoPixel LEDs are available as board.NEOPIXEL
.
The NeoPixel LEDs are available as PIN_NEOPIXEL
.
Speaker
Section titled “Speaker”The grey square a bit to the right of the center of the board on the back is the 8mm speaker/buzzer. It can be used to make simple beeps and sounds effects. The speaker must be enabled to work in code.
The speaker is available as board.SPEAKER
.
The speaker enable pin is board.SPEAKER_ENABLE
.
The speaker is available in Arduino as PIN_SPEAKER
.
The speaker enable pin is PIN_SPEAKER_ENABLE
.
Set the pin high to enable the speaker.
RED LED
Section titled “RED LED”On the top edge of the back of the board, to the right of the USB Type C connector is the red LED. You can control this in your code.
The red LED is available as board.LED
.
The red LED is available in Arduino as PIN_LED
.
The speaker enable pin is PIN_SPEAKER_ENABLE
.
Reset button
Section titled “Reset button”On the right edge of the back of the board (visible from the front), there is the reset button.
CircuitPython
Section titled “CircuitPython”CircuitPython is a derivative of MicroPython designed to simplify experimentation and education on low-cost microcontrollers.
It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads.
Simply copy and edit files on the CIRCUITPY
drive to iterate.
Install CircuitPython
Section titled “Install CircuitPython”Download the latest version of .
You’ll get a file named like adafruit_circuitpython_etc.uf2
.
- Enter the bootloader by holding down the BOOT button (press the rotary encoder), and while continuing to hold it, press and release the reset button (on the up left of the board).
- Continue to hold the BOOT button until the RPI-RP2 drive appears.
- Drag the
adafruit_circuitpython_etc.uf2
file to RPI-RP2. The RPI-RP2 drive will disappear and a new disk drive called CIRCUITPY will appear.
MacroPad CircuitPython library
Section titled “MacroPad CircuitPython library”You can take a look at the following documentation page:
Adafruit CircuitPython MacroPad library wraps all of MacroPad’s CircuitPython features into one place to make it super simple to get started using CircuitPython with your Adafruit MacroPad.
Installation
Section titled “Installation”To use the MacroPad library, you’ll need to install it and a few other CircuitPython libraries on your CIRCUITPY drive.
First of all, you need to install CircuitPython, then you can install this library.
The steps to install and use this library are:
- Download and unzip.
- Move into
CircuitPython 9.x
directory orCircuitPython 10.x
based on the language version on your board - Copy
lib
content into CIRCUITPY drive’slib
directory - Edit
code.py
file, happy coding!
Use the library:
from adafruit_macropad import MacroPad
macropad = MacroPad()
Important documentation link are:
Arduino
Section titled “Arduino”The Arduino Philhower core provides support for RP2040 microcontroller boards