Pro Mini: Pot to brightness, with Serial

by VladM

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.