The potentiometer reads an analog value from the hardware port and outputs a normalized result in the range from 0.0
to 1.0
, depending on the angle of the knob.
It brings an easy solution to control LEDs, servos, and system coefficients.
↓ Download as a Fritzing project
Let’s control the brightness of the LED with a potentiometer.
Connect a potentiometer to the Arduino board according to the scheme.
Set the PORT
pin value on the pot
node to A0
because it’s connected to the analog board port A0.
Link the pot
node VAL
pin to the LUM
pin on the led
node.
Upload your patch.
Rotate the knob and see how the LED reacts to it. Cool, eh?