Starting Electronics needs your help! Please make a donation to help cover our hosting and other costs. Click the donate button to send a donation of any amount.
Created on: 2 August 2012
A potentiometer is used to change the analog value on the Arduino A0 pin. Ten LEDs are connected to Arduino pins 2 to 11. As the voltage value on A0 increases, LEDs making up a bar graph will turn on in sequence.
File → Examples → 7.Display → barGraph
The circuit diagram and breadboard connections are shown on the barGraph page on the Arduino website.
Find the barGraph sketch in the Arduino IDE under File → Examples → 7.Display → barGraph and upload it to the Arduino board.
Turn the shaft of the potentiometer to make the LEDs switch on in turn.
Can't see the video? View on YouTube →