REM Example Infinite Loop
BUTTON_DEF
WHILE TRUE
LED_R
DELAY 500
LED_OFF
DELAY 500
END_WHILE
END_BUTTON
WHILE TRUE
LED_G
DELAY 500
LED_OFF
DELAY 500
END_WHILE
REM Because a button definition has been initiated with BUTTON_DEF, the default behavior will no longer apply when the button is pressed.
REM The LED will blink green: half a second on, half a second off.
REM Pressing the button will stop the currently infinite loop of blinking the LED green and execute the button definition, thus blinking the LED red.