CNAP

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

NameDescription
VCCPower (5V)
SIGSignal (wiper) — connect to an analog input pin
GNDGround

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

DescriptionAttrs
Default slide potentiometer{}

See also