Skip to main content

Button pins

The MacroBoard uses seven GPIO pins for button inputs, configured with internal pull-up resistors.
GPIO 4
Toggle shuffle mode on/off in Spotify playback
GPIO 5
Decrease playback volume
GPIO 12
Increase playback volume
GPIO 13
Toggle repeat/loop mode in Spotify
GPIO 14
Skip to previous track
GPIO 25
Toggle play/pause state
GPIO 26
Skip to next track

I2C pins

The OLED display uses the I2C protocol for communication.
GPIO 21
I2C data line for OLED display communication
GPIO 19
I2C clock line for OLED display communication
The I2C bus runs at 400 kHz for faster display updates.

LED pin

GPIO 18
WS2812B RGB LED strip data pin

RGB LED configuration

The MacroBoard uses an addressable LED strip for visual feedback.
WS2812B
Addressable RGB LED chip
20
Number of LEDs in the strip
GRB
Green-Red-Blue color byte order
230
Maximum brightness level (0-255)
5V @ 500mA
Maximum voltage and current draw
100 Hz
LED updates per second
Ensure your power supply can handle 500mA at 5V when running all 20 LEDs at full brightness.

OLED display configuration

The display uses the SSD1306 driver with I2C communication.
SSD1306
OLED display controller chip
128x64
Display width and height in pixels
0x3C
Hardware I2C address for the display
-1
No hardware reset pin used (software reset only)
400 kHz
I2C bus frequency

Pin initialization

All button pins are configured as inputs with internal pull-up resistors enabled. The buttons should connect the GPIO pin to ground when pressed.
The I2C pins are configured with pull-up resistors:
The ESP32’s internal pull-up resistors are sufficient for button debouncing and I2C communication. External pull-up resistors are not required.

Hardware connections

Button wiring

Each button should be wired as follows:
  • One terminal to the GPIO pin
  • Other terminal to GND
  • No external resistors needed (internal pull-ups are used)

LED strip wiring

  • Data: GPIO 18
  • VCC: 5V power supply
  • GND: Common ground with ESP32

OLED display wiring

  • SDA: GPIO 21
  • SCL: GPIO 19
  • VCC: 3.3V or 5V (depending on display module)
  • GND: Common ground with ESP32
Ensure all components share a common ground connection with the ESP32 to prevent communication issues.