Slide Potentiometer Reference
A linear-travel variable resistor used as an analog input, functionally identical to a rotary Potentiometer but controlled by sliding rather than turning.
Pin names
| Name | Description |
|---|---|
| VCC | Power (5V) |
| SIG | Signal (wiper) — connect to an analog input pin |
| GND | Ground |
Attributes
This component has no configurable attributes.
Usage
Connect VCC to 5V, GND to GND, and SIG to an analog input pin (A0–A5 on an Uno).
Read the value with analogRead(), which returns 0–1023.
const int SLIDER_PIN = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int value = analogRead(SLIDER_PIN);
Serial.println(value);
delay(100);
}
Examples
| Description | Attrs |
|---|---|
| Default slide potentiometer | {} |
See also
- Potentiometer — rotary equivalent
- Analog Joystick — two-axis analog input using the same principle