LED commands
Mantis’s single onboard status LED is fully scriptable — there’s no fixed meaning attached to it, only what your script tells it to do:
| Command | Behavior |
|---|---|
LED_ON | Turns the onboard LED on. |
LED_OFF | Turns the onboard LED off. |
Combine both with DELAY to build a blink pattern, e.g. to signal that a script
is about to finish:
blink.mantis
1REM Simple blink pattern2LED_ON3DELAY 3004LED_OFF5DELAY 300Custom indications
You can combine LED commands with loops and conditional logic to create custom indicators. For example, you can blink the LED rapidly to tell the user that the script is paused and waiting for a physical button press before continuing.
wait_for_button.mantis
1REM Set typing speed for when we resume2SET_SPEED $Human34REM Loop infinitely until the button is pressed5LOOP6 REM Create a rapid blink pattern7 LED_ON8 DELAY 1009 LED_OFF10 DELAY 10011 12 REM Check if the user has pressed the button13 IF BUTTON_PRESSED THEN14 REM Exit the loop and continue the script15 BREAK16 END_IF17END_LOOP1819REM The script only reaches here once the button is pressed20STRINGLN The button was pressed. Resuming execution!See the LEDs hardware page for the LED itself.
Last updated on