Xil.se is more than just a CTF team. We’re doing some hardware projects and will start posting about them now. First out is the RGB Pad. A quite quick and dirty project, but fun nonetheless.

Sorry about the vertical video

RGBPad is a button pad with fully addressable RGB LEDs. It is acting as an I2C slave and is designed to be connected in an array of multiple devices.


  • Each RGBPad has an STM32F030C8T6 on board that acts as an I2C slave with a unique ID. This STM is dirt cheap and can be run without a crystal or passive components.
  • The RGBPads are connected to each other on a I2C bus.
  • When a button is pressed, the shared line NINT will be pulled down and the I2C master gets interrupted. This is to prevent the master from having to poll for button presses constantly. It may be a premature optimization though and will probably not be used.
  • Each RGBPad has its own framebuffer for the LEDs. By sending a specific command, the framebuffer may be updated and pushed out to the LEDs.
  • The LEDs used are the APA102. They have their own PWM and keep their state.

alt tag


Because it’s fun.

One idea is to use another device as a MIDI interface that uses these boards as keys/pads. Should be possible to use the not yet announced Thumbinator to do this.


kbeckmann, arturo182

Where’s the code


  • Write all the code
  • Implement I2C slave
    • 0x01: Request button states. Reply with a uint16 with all the button states in row major order.
    • 0x02: Set LED colors. Payload is a full framebuffer in snake order.
    • 0x03: Fade to framebuffer. Sets a new framebuffer and blend colors to this using s-curve interpolation/ease inout. Should take a uint16 with length of animation in milliseconds.
    • Use higher speed. 400 kHz should work, but we should try to go even faster.
    • Make it more reliable. Recover after faliures after connecting more boards while running.
  • Implement I2C master on a STM32 for test that sends LED data and prints pressed buttons on UART.
    • Partly done, implemented a quick hack in lua for the NodeMCU.
  • Implement some simple game (why not?).
  • Finish the MIDI controller. But that’s probably a project of its own.

Project log


  • PCB rev1 design is done.
  • 10 PCBs have been ordered.
  • 5 boards have been populated with components.
  • Firmware for I2C slave is in a demoable state in 100kHz mode.
  • Tested the firmware using a quick lua hack on a NodeMCU (ESP8266).
  • Got a 3d printed bezel from arturo182.

alt tag