Docs
Value Display
The Value Display widget shows a number your board sends, as text. No dial, no needle, just the reading.
Use it for: temperature, humidity, pressure, uptime, a counter, a short status word.
| Setting | What it does |
|---|---|
| Pin | the virtual pin your code writes to |
| Decimals | how many digits after the point |
| Unit | text appended to the number, such as °C or % |
| Label | the name shown above the value |
Open these from the canvas: tap Edit, then long press the widget and choose Configure.
Labeled Value is the same widget with the label drawn beside the number instead of above it. The code is identical.
Example
Send a humidity reading to a Value widget on V6 every five seconds.
#include <PlynxSimpleEsp32.h>
#define SENSOR_PIN 35 // ADC1 pin, works while WiFi is on
PlynxTimer timer;
void sendHumidity()
{
int raw = analogRead(SENSOR_PIN); // 0 to 4095 on the ESP32
float percent = raw * 100.0 / 4095.0;
Plynx.virtualWrite(V6, percent);
}
void setup()
{
Serial.begin(115200);
// Auto setup: WiFi and the Plynx token are configured from the app.
//
// To provide them directly in the sketch instead, use:
// Plynx.begin(auth, ssid, pass);
Plynx.begin();
timer.setInterval(5000L, sendHumidity);
}
void loop()
{
Plynx.run();
timer.run();
} Send the raw number and let the widget format it. Setting decimals to 1 in
the app turns 41.8372 into 41.8, so your sketch does not need to round.
Do not add the unit in the sketch. virtualWrite(V6, "41.8 %") arrives as text
and stops the widget treating it as a number.
Sending text
The Value Display widget accepts a short string too:
Plynx.virtualWrite(V6, "Filling"); Keep it short. Long strings get cut off at the widget edge, and charts built on the same pin cannot use them.
Troubleshooting
| Problem | Check |
|---|---|
| Widget stays empty | nothing calls virtualWrite() on that pin |
| Value never changes | timer.run() is missing from loop() |
| Too many digits | set Decimals in the widget settings, not in the sketch |
| Readings jump on WiFi | ADC2 pins stop working with WiFi on; use GPIO 32 to 39 |