<!-- Source: https://medius.k4tech.net/native/commands/led -->
# LED

_Drive a status LED_

[`LED`](/native/commands/led.md#led) overrides one of the box's status LEDs, or hands it back to the box's own status display. Each chip has a single green LED, and by default each shows its own state. It's [fire-and-forget](/native/injection.md#fire-and-forget).

## LED

_Override or restore a status LED_

`LED` picks a chip's green LED and either forces it to a pattern or returns it to its auto status display. [Opcode](/native/frame.md#opcodes) `0x09`.

```text
LED 0x09 · payload 3 bytes
```

_Fire-and-forget_

#### PAYLOAD

| Offset | Field | Type | Notes |
| --- | --- | --- | --- |
| 0 | `target` | `u8` | which chip's LED (see below) |
| 1 | `mode` | `u8` | what to drive it to (see below) |
| 2 | `level` | `u8` | brightness 0-255; used by solid and blink, ignored for off and auto |

#### TARGETS

| Target | Value | LED |
| --- | --- | --- |
| device | `0` | The device chip's own LED. |
| host | `1` | The host chip's LED; the device relays it over the [inter-chip link](/native/architecture.md#data-flow). |
| both | `2` | Both LEDs at once. |

#### MODES

| Mode | Value | Effect |
| --- | --- | --- |
| auto | `0` | Hand the LED back to the box's status display (see below). |
| off | `1` | LED dark. |
| solid | `2` | LED lit steadily at `level` brightness. |
| blink | `3` | LED blinks at `level` brightness. |

#### STATUS DISPLAY

In `auto` (the default), each chip drives its own LED from its state. The device chip is solid when the inter-chip link, the real mouse, and the clone are all up, slow-blinks when the link is up but the mouse or clone is missing, and is off with no link. The host chip is solid while the mouse is streaming and off when it isn't.

#### EFFECT

An override holds until you send `auto` again, and the box also reverts it to status on control-PC silence (the same ~1 s timeout that clears [injection](/native/injection.md#safety)), on [`RESET`](/native/commands/admin.md#reset), or on inter-chip link loss. The LED is PC-owned state, released like injection. There's no game-PC-visible surface: a host or both override travels the inter-chip link only. Library binding: [`led`](/library/led.md#led).

#### EXAMPLE

Both LEDs to blink at `level = 200` (`0xC8`):

```
+--------+--------+--------+--------+--------+--------+--------+--------+
| A5     | 09     | 00     | 03 00  | 02     | 03     | C8     | lo hi  |
+--------+--------+--------+--------+--------+--------+--------+--------+
| SOF    | TYPE   | SEQ    | LEN    | target | mode   | level  | CRC16  |
+--------+--------+--------+--------+--------+--------+--------+--------+
```
