The MacroPad RP2040 is full of macropad deliciousness. It has some great features beyond the keys. Time for tour!
PDF of the pinouts image above is available here.
On the MacroPad, laid out in a 3x4 grid, are the Cherry-MX compatible key switch sockets. They are mounted on the back of the board so the socket points through to the front. The key switch sockets are individually tied to GPIO pins (i.e. not matrix-wired).
Simply press any compatible key switch into the socket from the top of the board. You can add a dab of glue to keep the switch in place; hot glue or a dot of epoxy will work.
The sockets are available in CircuitPython as
board.KEY1 through b
oard.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), is the rotary encoder / BOOT button. The rotary encode has 20 detents per rotation. The BOOT button is required to enter the bootloader (needed for both CircuitPython and Arduino), and is also available as a user input in code. To use the button, simply press the rotary encoder down.
The rotary encoder is available in CircuitPython at
board.ENCODER_B. It is available in Arduino as
The BOOT button is available in CircuitPython at
board.BUTTON. It is available in Arduino at
PIN_SWITCH. 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. The ribbon cable for the display goes through a hole in the board to the back, where it is inserted into the display connector. This OLED is on high-speed hardware SPI to ensure quick updates.
Above each set of key switch sockets, are RGB NeoPixel LEDs laid out in the same 3x4 grid. These reverse-mount LEDs are mounted to the back of the board to shine through to the front (to allow for the key switches to sit flush against the front of the board!).
The NeoPixel LEDs are available in CircuitPython as
board.NEOPIXEL. They are available in Arduino as
The large square on the back of the board, at the top-center, is the RP2040 microcontroller. This is the brain of the board.
The little square above the RP2040 microcontroller is the 8MB QSPI flash.
QSPI is neat because it allows you to have 4 data in/out lines instead of just SPI's single line in and single line out. This means that QSPI is at least 4 times faster. But in reality is at least 10x faster because you can clock the QSPI peripheral much faster than a plain SPI peripheral. In CircuitPython, the QSPI flash is used natively by the interpreter and is read-only to user code, instead the flash just shows up as the writable disk drive!
The grey square a bit to the right of the center of the board on the back is the 8mm speaker/buzzer. With a Class D amplifier and RC filter, it can be used to make simple beeps and sounds effects.
The speaker is available in CircuitPython at
board.SPEAKER. It is available in Arduino at
The speaker must be enabled to work in code. The speaker enable pin in CircuitPython is
board.SPEAKER_ENABLE. In Arduino, it is
PIN_SPEAKER_ENABLE. Set the pin high to enable the speaker.
In the top right corner of the back of the board, below the mounting boss, is the STEMMA QT connector. This Qwiic-compatible I2C connector is designed to make it super simple to connect up STEMMA QT sensors and breakouts.
The I2C SCL and SDA pins on the connector are connected to 10k pull-up resistors, so they will be at 3.3V when quiescent.
In CircuitPython, you can use the STEMMA connector with
At the top-center of the board, visible from both sides, is the USB Type C connector. This connector is used both for transferring data from your computer (e.g. updating your CircuitPython code.py file, or uploading an Arduino sketch) and powering the board.
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 in CircuitPython at
board.LED. It is available in Arduino at
On the right edge of the back of the board (visible from the front), below the STEMMA QT connector, is the reset button. Tap once to reset the board. When combined with the boot button, the reset button allows the board to enter the bootloader.