The bar graph - a series of LEDs in a line, such as you see on an audio display - is a common hardware display for analog sensors. It's made up of a series of LEDs in a row, an analog input like a potentiometer, and a little code in between.
This tutorial demonstrates how to control a series of LEDs in a row, but can be applied to any series of digital outputs.
This tutorial borrows from the For Loop and Arrays tutorial as well as the Analog Input tutorial.
Step 1: What You Need?
1 x Arduino Board ( Arduino UNO R3 used in this tutorial.)
1 x LED Bar Graph Display or 10 x LEDs
1 x Potentiometer
10 x 220 Ohm Resistors
1 x Breadboard
1 x USB Type-B Cable
Male-to-Male Jumper Wires
Optional
Arduino Uno R3 Acrylic Transparent Casing
Arduino Compatible UNO Ultimate Starter Kit / Learning Kit
Don't have components? Don't worry. Just click the component's name.
1 x LED Bar Graph Display or 10 x LEDs
1 x Potentiometer
10 x 220 Ohm Resistors
1 x Breadboard
1 x USB Type-B Cable
Male-to-Male Jumper Wires
Optional
Arduino Uno R3 Acrylic Transparent Casing
Arduino Compatible UNO Ultimate Starter Kit / Learning Kit
Don't have components? Don't worry. Just click the component's name.
Step 2: Build Your Circuit.
Step 3: Upload The Code.
1. Select the Arduino board type: Select Tools >> Board >> Select your correct Arduino board used.
2. Find the port number by accessing device manager on Windows. See the section Port (COM&LPT) and look for an open port named "Arduino Uno (COMxx)". If you are using a different board, you will find a name accordingly. What matters is the xx in COMxx part. In my case, it's COM3. So my port number is 3.
Select the right port: Tools >> Port >> Select the port number.
3. You can find this code in the example of Arduino IDE.
Select File >> Examples >> 07. Display >> barGraph
Click press the "upload" button (see the button with right arrow mark).
Arduino IDE
0 comments:
Post a Comment