- breadboarding LED outputs from the Arduino
- creating and reading digital inputs to the Arduino
- how to program the Arduino to take the input and act on it to modify the outputs
Our demonstration project will consist of a set of three blinking LED's that blink in sequence. You'll control the speed of the blinks via a pushbutton controller. I've designed this project to be modular in nature: we can create a fairly complex effect, but I've wired and coded everything in a modular fashion to make it easier to follow. Of course, that means that neither the circuits nor the code are necessarily the most efficient way of doing things -- but the emphasis here is on making it clear and understandable.
Acknowledgement: I'd like to thank Lady Ada for her excellent set of tutorials on the Arduino which is where I first learned Arduino basics. I cover a lot of the same ground, but her work has a very different flavor and emphasis including a different set of circuits and programs. I recommend that you pay her tutorials a visit. You can also buy Arduino boards and an wide variety of shields and accessories for the Arduino from her company, Adafruit Industries.
Here's how the finished project behaves:
Remove these ads by
Signing UpStep 1Testing Your Board / Getting Started
1) Download the software you'll need from the makers: Software Download.
2) Install the software and connect your Arduino to your computer via a USB cable. It draws power directly from the USB port, so you don't need to connect a power supply to it at this point.
3) If you have a newer board you'll see a resistor next to pin 13 and an LED next to that. That LED works just as if it were connected between pin 13 and the ground (GND) pin next to it. If the LED is NOT on your board, just connect an LED between 13 and GND. You don't need to do anything else since a resistor is already built in and limits the current through the LED so you don't put your board at risk of a short circuit. NOTE: This resistor may not be present on really old boards (I just don't know), but I doubt you have one of those.
4) Set your board type and serial port under "Tools" in the software kit. The current version (at the time of writing) does not have an option for the newest Duemilanove boards, but choosing Diecimila works just fine.
5) Open the blink example from the software kit: It's under File | Sketchbook | Examples | Digital. The onboard LED (or the one you added) should blink on and off after you upload the Blink "sketch" (as Arduino projects are called) to the board (File | Upload).
When you write programs for your Arduino, you will normally do much of your debugging in the software development kit by doing a Verify/Compile before uploading, but since we just uploading a pre-built test sketch I skipped that here.
| « Previous Step | Download PDFView All Steps | Next Step » |











































But don't play with transistors :P .. I roasted 2 pins on my atmega168 by connecting transistors to it the wrong way, but I already ordered some new atmega328's :D
I also ordered a new one!
Where do you order your chips from?
Atleast i only roasted 2 pins (so far) on my 168, so I can still use the other pins :)
http://www.netram.co.za
I need your help.I have Arduino Duemilnove but nothing happen when I plug it through USB.The first time I plugued it it went through the installation.but when I plug it now the computer does not detect it!
another thing I downloaded all the drivers but when I try to unzip them ,they are kind of non-executable!?what to do .your help is greatly appreciated.Thanks again.
Ijabi
and how many pin switch did u use 4 or 2
The "int" before the variable names defines what kind of information the variable will store. In the case of "int" it means the value will be an integer. Other common variable types are "float" for floating point (decimal) numbers and "char" for characters. There are quite a few types. The full language reference for the Arduino is here: http://arduino.cc/en/Reference/HomePage
The button: white - pin 2, orange - 5V, blue - ground.
The diodes: All white cables are connected to ground on this part of the bread board. Connect ground to resistor and then all diodes to the other end of the resistor.
I also modified the code to fix some bugs and look better in general (in my opinion): http://pastebin.com/f4474a984
Larger pictures: 1, 2, 3.