LED Rainbow
This example goes through a rainbow effect by gradually changing the LED colors. The loop runs indefinitely until the device is unplugged.
LOOP_BEGINstarts an infinite loop.LED r g bsets the LED color using red, green, and blue values (0-255).DELAYpauses execution for the specified number of milliseconds.
LOOP_BEGIN
# --- RED to YELLOW ---LED 255 0 0DELAY 100LED 255 32 0DELAY 100LED 255 64 0DELAY 100LED 255 96 0DELAY 100LED 255 128 0DELAY 100LED 255 160 0DELAY 100LED 255 192 0DELAY 100LED 255 224 0DELAY 100LED 255 255 0DELAY 100
# --- YELLOW to GREEN ---LED 192 255 0DELAY 100LED 128 255 0DELAY 100LED 64 255 0DELAY 100LED 0 255 0DELAY 100
# --- GREEN to CYAN ---LED 0 255 32DELAY 100LED 0 255 64DELAY 100LED 0 255 96DELAY 100LED 0 255 128DELAY 100LED 0 255 160DELAY 100LED 0 255 192DELAY 100LED 0 255 224DELAY 100LED 0 255 255DELAY 100
# --- CYAN to BLUE ---LED 0 224 255DELAY 100LED 0 192 255DELAY 100LED 0 160 255DELAY 100LED 0 128 255DELAY 100LED 0 96 255DELAY 100LED 0 64 255DELAY 100LED 0 32 255DELAY 100LED 0 0 255DELAY 100
# --- BLUE to MAGENTA ---LED 32 0 255DELAY 100LED 64 0 255DELAY 100LED 96 0 255DELAY 100LED 128 0 255DELAY 100LED 160 0 255DELAY 100LED 192 0 255DELAY 100LED 224 0 255DELAY 100LED 255 0 255DELAY 100
# --- MAGENTA to RED ---LED 255 0 224DELAY 100LED 255 0 192DELAY 100LED 255 0 160DELAY 100LED 255 0 128DELAY 100LED 255 0 96DELAY 100LED 255 0 64DELAY 100LED 255 0 32DELAY 100LED 255 0 0DELAY 100
# --- LOOP BACK ---LOOP_END