Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/benz206/SpotifyMacroBoard/llms.txt

Use this file to discover all available pages before exploring further.

Button pins

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

I2C pins

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

LED pin

LED
GPIO 18
WS2812B RGB LED strip data pin

RGB LED configuration

The MacroBoard uses an addressable LED strip for visual feedback.
Chip type
WS2812B
Addressable RGB LED chip
LED count
20
Number of LEDs in the strip
Color order
GRB
Green-Red-Blue color byte order
Brightness
230
Maximum brightness level (0-255)
Power limit
5V @ 500mA
Maximum voltage and current draw
Update rate
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.
Driver
SSD1306
OLED display controller chip
Resolution
128x64
Display width and height in pixels
I2C address
0x3C
Hardware I2C address for the display
Reset pin
-1
No hardware reset pin used (software reset only)
Clock speed
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.
for (int i = 0; i < 7; i++) {
    pinMode(keys[i], INPUT_PULLUP);
}
The I2C pins are configured with pull-up resistors:
pinMode(SCL, INPUT_PULLUP);
pinMode(SDA, INPUT_PULLUP);
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.

Build docs developers (and LLMs) love