Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Button control

Tobias Blum edited this page Jan 21, 2018 · 1 revision

Wiring

Connect your button between the pin you configured in definitions.h and ground.

Configuration

Uncomment the following line, to enable button control:

// #define ENABLE_BUTTON  // If defined, enable button handling code.

To select which mode should be started on the different key presses, set the following definitions:

#define BTN_MODE_SHORT "STA| 1|  0|245|196|255|255|255"   // Static white
#define BTN_MODE_MEDIUM "STA| 1| 48|245|196|255|102|  0"  // Fire flicker
#define BTN_MODE_LONG "STA| 1| 46|253|196|255|102|  0"    // Fireworks random

The format is (separated by pipes):

  • STA: Static value
  • Mode: McLighting mode as defined here. Set to 1 if you want to set a WS2812FX mode.
  • WS2812FX mode: The mode of the WS2812FX animation (see the number in the McLighting web frontend)
  • Speed: From 0 to 255
  • Brightness: From 0 to 255
  • Red: Color value from 0 to 255
  • Green: Color value from 0 to 255
  • Blue: Color value from 0 to 255

It's the same format like it's used to save the state in EEPROM. You could also set a mode and copy the value from serial log.

Clone this wiki locally