Slider Widget
The Slider lets you drag a handle across a numeric range and sends the selected value to a virtual pin in real time. Perfect for dimmer controls, motor speed, servo angle, or any continuously variable output.
Default size: 3 × 1 grid cells
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
min | number | 0 | Minimum value |
max | number | 255 | Maximum value |
orientation | horizontal | vertical | horizontal | Slider direction |
color | hex color | #3B82F6 | Track fill color |
| Device | device | — | The device to write to |
| Pin | V0–V255 | — | The virtual pin to write to |
| Label | string | — | Widget label |
Firmware example
// LED dimmer (0–255)
VWIRE_RECEIVE(V3) {
int brightness = param.asInt(); // 0–255
analogWrite(LED_PIN, brightness);
}
// Servo angle (0–180)
VWIRE_RECEIVE(V4) {
int angle = param.asInt();
myServo.write(angle);
}
// Motor speed percentage (0–100)
VWIRE_RECEIVE(V5) {
float percent = param.asFloat();
int pwm = map(percent, 0, 100, 0, 255);
analogWrite(MOTOR_PIN, pwm);
}
Step values
| Use case | min | max | step |
|---|---|---|---|
| LED brightness | 0 | 255 | 1 |
| Servo angle | 0 | 180 | 1 |
| Fan speed % | 0 | 100 | 5 |
| Temperature setpoint | 16 | 30 | 0.5 |
| Volume | 0 | 100 | 2 |
Orientation
- Horizontal — standard left-to-right; recommended for wide layouts (3×1 default)
- Vertical — bottom-to-top; use in a taller cell (1×3 or 2×3) for fader-style controls