Skip to content

MacroPad RP2040 Overview

adafruit-macropad-rp2040-pinout

You can buy MacroPad on the official Adafruit store.

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.

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.

Pressing the button grounds the pin.

On the top left corner of the board (when viewed from the top), is the 128x64 SH1106 Monochrome OLED display.

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 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.

Set the pin high to enable the speaker.

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.

On the right edge of the back of the board (visible from the front), there is the reset button.

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.

Download the latest version of .

You’ll get a file named like adafruit_circuitpython_etc.uf2.

  1. 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).
  2. Continue to hold the BOOT button until the RPI-RP2 drive appears.
  3. 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.

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.

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:

  1. Download and unzip.
  2. Move into CircuitPython 9.x directory or CircuitPython 10.x based on the language version on your board
  3. Copy lib content into CIRCUITPY drive’s lib directory
  4. Edit code.py file, happy coding!

Use the library:

from adafruit_macropad import MacroPad
macropad = MacroPad()

Important documentation link are:

The Arduino Philhower core provides support for RP2040 microcontroller boards