LED Widget
The LED widget renders a small colored circle that lights up or dims based on a virtual pin value. Ideal for showing boolean states: alarm on/off, pump running, door open/closed.
Default size: 1 × 1 grid cells
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
onColor | hex color | #10B981 | Color when value equals onValue |
offColor | hex color | #6B7280 | Color when value does not match onValue |
onValue | string | 1 | The value that triggers the ON state |
| Device | device | — | The device to read from |
| Pin | V0–V255 | — | The virtual pin to display |
| Label | string | — | Widget label |
Firmware example
void loop() {
Vwire.run();
bool motionDetected = digitalRead(PIR_PIN);
bool doorOpen = digitalRead(DOOR_PIN);
Vwire.virtualSend(V5, motionDetected ? 1 : 0);
Vwire.virtualSend(V6, doorOpen ? 1 : 0);
delay(200);
}
Semantic color palette
| State | Color | Hex |
|---|---|---|
| OK / ON | Green | #10B981 |
| Warning | Amber | #F59E0B |
| Error | Red | #EF4444 |
| Info | Blue | #3B82F6 |
| Inactive | Gray | #6B7280 |
Multiple LEDs as a status board
Place several 1×1 LED widgets in a row to create a simple multi-channel status board:
| Pin | Label | Color |
|---|---|---|
| V5 | Motion | #EF4444 |
| V6 | Door | #F59E0B |
| V7 | Pump | #10B981 |
| V8 | Alarm | #EF4444 |