> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/lan-turtle-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/led.md).

# LED

The `LED` command controls the RGB LED on the front of the LAN Turtle Hub.

### Options <a href="#options" id="options"></a>

`LED [color] [pattern]`

`LED [state]`

#### Colors <a href="#colors" id="colors"></a>

| Color | Result                     |
| ----- | -------------------------- |
| R     | Red                        |
| G     | Green                      |
| B     | Blue                       |
| Y     | Yellow (Red + Green)       |
| C     | Cyan (Green + Blue)        |
| M     | Magenta (Red + Blue)       |
| W     | White (Red + Blue + Green) |

#### Patterns <a href="#patterns" id="patterns"></a>

| Pattern  | Result                                              |
| -------- | --------------------------------------------------- |
| SOLID    | No blinking (default)                               |
| SLOW     | Slow symmetric blinking (1 second ON, 1 second OFF) |
| FAST     | Fast symmetric blinking (100ms ON, 100ms OFF)       |
| VERYFAST | Very fast symmetric blinkig (10ms ON, 10ms OFF)     |
| SINGLE   | 1 100ms blink ON, 1 second OFF, repreating          |
| DOUBLE   | 2 100ms blinks ON, 1 second OFF, repeating          |
| TRIPLE   | 3 100ms blinks ON, 1 second OFF, repeating          |
| QUAD     | 4 100ms blinks ON, 1 second OFF, repeating          |
| QUIN     | 5 100ms blinks ON, 1 second OFF, repeating          |
| ISINGLE  | 1 100ms blink OFF, 1 second ON, repeating           |
| IDOUBLE  | 2 100ms blinks OFF, 1 second ON, repeating          |
| ITRIPLE  | 3 100ms blinks OFF, 1 second ON, repeating          |
| IQUAD    | 4 100ms blinks OFF, 1 second ON, repeating          |
| IQUIN    | 5 100ms blinks OFF, 1 second ON, repeating          |
| SUCCESS  | 1 second VERYFAST, followed by SOLID                |

#### States <a href="#states" id="states"></a>

Instead of setting a color+pattern, the `LED` command can also be used to set a standard color code for a state.

| State    | Pattern    |
| -------- | ---------- |
| SETUP    | M SOLID    |
| FAIL     | R SLOW     |
| FAIL1    | R SLOW     |
| FAIL2    | R FAST     |
| FAIL3    | R VERYFAST |
| ATTACK   | Y SINGLE   |
| STAGE1   | Y SINGLE   |
| STAGE2   | Y DOUBLE   |
| STAGE3   | Y TRIPLE   |
| STAGE4   | Y QUAD     |
| STAGE5   | Y QUIN     |
| SPECIAL  | C ISINGLE  |
| SPECIAL1 | C ISINGLE  |
| SPECIAL2 | C IDOUBLE  |
| SPECIAL3 | C ITRIPLE  |
| SPECIAL4 | C IQUAD    |
| SPECIAL5 | C IQUIN    |
| CLEANUP  | W FAST     |
| FINISH   | G SUCCESS  |
| OFF      |            |

### Experimenting <a href="#experimenting" id="experimenting"></a>

You can experiment using the `LED` command live, either in the Web Shell in the web UI, or via `ssh`!

### Examples <a href="#examples" id="examples"></a>

```
#!/bin/bash

# Title: LED demo
# Description: Set the LED to various states

LED G SOLID
sleep 5
LED SPECIAL5
sleep 5
LED CLEANUP
sleep 5
LED M VERYFAST
```
