LCD Widget
The LCD widget simulates a character LCD screen with a retro green-on-black or amber-on-black look. It supports up to 4 rows and arbitrary column widths. Send text lines from your device or build multi-value dashboards with a single widget.
Default size: 3 × 2 grid cells
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
rows | 1 | 2 | 4 | 2 | Number of display rows |
cols | number | 16 | Characters per row |
theme | green | amber | blue | green | Screen color theme |
| Device | device | — | The device to read from |
| Pin | V0–V255 | — | The virtual pin for display data |
| Label | string | — | Widget label |
Sending data to the LCD
Single-line string
Vwire.virtualSend(V0, "Hello VWire!");
Multi-line: use \n separator
char buf[64];
float temp = 23.5, hum = 61.0;
snprintf(buf, sizeof(buf), "Temp: %.1f C\nHum: %.0f %%", temp, hum);
Vwire.virtualSend(V0, buf);
This renders as:
Temp: 23.5 C
Hum: 61 %
Structured multi-row with JSON
char buf[128];
snprintf(buf, sizeof(buf),
"[\"Temp: %.1f C\",\"Hum: %.0f%%\",\"Pres: %d hPa\",\"UV: %.1f\"]",
temp, hum, pres, uv);
Vwire.virtualSend(V0, buf);
Format tricks
| Technique | How |
|---|---|
| Right-align a number in 16-char row | snprintf(buf, 17, "%16.1f C", temp) |
| Blinking text | Alternate the string every push with spaces |
| Progress bar in ASCII | [######## ] 80% |
| Custom characters | Not supported (font is fixed) |
Tips
Push only on change
To avoid unnecessary traffic, compare the previous display string and skip virtualSend if nothing changed.