Pro Mini: Pot to brightness, with Serial
5 parts
A 10kΩ pot sets an LED's brightness. The sketch reads the wiper on A0 (analogRead: 0 to 1023 for 0 to 5 V), maps it to 0 to 255 with map(), writes that to D9 with analogWrite, and prints both numbers at 9600 baud every 200ms. At 30% the wiper sits at 1.50V.
- U1 s4.hex
- V1 5V
- POT1 10kΩ·30%
- R1 330Ω
- LED1