Read a pot, control 5 LEDs
The pot controls which LED is turned on. The pot is connected to Arduino pin A0. analogRead is used to measure the voltage at A0. You will get a value between 0 and 1023 (where 0 equals ground and 1023 equals +5 volts). The analog range is divided into 5 sections (1023 / 5). Five LEDs are connected to the digital pins 2, 3, 4, 7 […]