Knob Controls LED Brightness
Combine a pot reading with PWM output.
Let a Knob Do the Driving
Now you combine two skills: read a potentiometer and use that reading to set an LED's brightness in real time. 🎛️
The Knob Speaks 0 to 1023
analogRead gives you a 0 to 1023 value as you turn the pot. That is the position of the knob expressed as a number.
int knob = analogRead(A0);All lessons in this course
- What PWM Actually Does
- analogWrite 0–255
- Fade an LED Up and Down
- Knob Controls LED Brightness