LEDs are a fun and intuitive way to interact with a user of Relay. There are 12 configurable LEDs on a Relay.
The LEDs can be toggled by their index which range from 1 to 12 respectively. To configure colors, they have to be passed into the respective function as a string of Hex values.
There are currently 8 different LED functions within the Relay SDK:
This function toggles a single LED on at a certain index with a certain color.
This function turns all 12 LEDs on with a single color.
This functions turns off all LEDs.
This functions causes the all LEDs to light up in a rainbow configuration and rotate. You can pass how many times you want the LEDs to rotate. By default, its -1 which means it will rotate indefinitely.
This function causes all the LEDs to rotate in a static color indefinitely. By default it's white.
This function causes all the LEDs to flash in a static color indefinitely. By default it's blue.
This function causes all the LEDs to breathe slowly in a static color indefinitely. By default it's blue.
This is the all encompassing function to program the LEDs to behave however you want. You can target exactly which LEDs you want on and what color.
The first input in the function (
the second input (
This toggles the first 3 LEDs to red and the 4th and 5th LEDs to green. LEDs 6-12 will be off.
Updated about 1 month ago