Arduino TutorialLesson 1
Arduino TutorialLesson 1
be blink!
Intro
Starting
Lesson 0
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
#6 - LEDs
LCDs
Eth + SD
HELP!!!
Buy stuff
Forums
Home
About
o ladyada.net
o Portfolio
o Research
o Press
o Publication & Presentation
o Photos
o Wiki (backend)
Projects
o Arduino »
Datalogger Shield
Ethernet Shield
GPS Shield
Proto Shield
Motor Shield
Wave Shield
USB Gamepad
Halloween Pumpkin
Vintage Bike Lite
Kite Arial Photo
Bike Stand
LiIon Bike Lite
Pogo Jib
Mass Programming
Solar LiPo Charging
Magstripe Reader
Solar Tracker
TRON Bag
o More...
o ->Instructables
Learn
o Arduino tutorial
o AVR tutorial
o Barcode scanners
o EL Wire tutorial
o LCDs
o LEDs
o Multimeter tutorial
o Digital scales
o Sensors »
FSR
CdS Photocell
Temperature
Tilt
PIR
Thermocouple
IR Receiver
o Breakout boards »
DS1307 RTC
MAX6675
ATmega32u4 Breakout+
o Products »
Library
o Arduino Hacks
o Batteries
o Boost Calc
o E.E. Tools
o E.E. Computer
o Find Parts
o Kits
o Laser
o uC Annoyances
o Open Source Hardware
o PCB Design & Tips
o PIC vs. AVR
o Software
o SMT
o Zen-Cart Mods
Blog
Store
Forums
Search
ladyada.net
Introduction
Ah yes, it is finally time to make your Arduino do something! We're going to start with the classic hello
world! of electronics, a blinking light.
This lesson will basically get you up and running using the Arduino software and uploading a sketch to the
Arduino board. Once you've completed this step we can continue to the really exciting stuff, which is when we
start writing our own sketches!
These instructions mostly show Windows software. Except when indicated, the software (should be) identical
on all platforms. Linux will be added once I figure out how to get it working (yay)
Assembled Adafruit $3
Arduino board, 5
preferrably a
Diecimila (or
whatever the latest
version is)
Go to the Arduino Software Download page and grab the right file for your OS. As of Sept 2007 the version
is 009 but you should use whatever is most recent.
The packages are quite large, 30-50 MB so it may take a while to finish
Mac OS X
Windows
Mac OS X
Startup!
Double click the Arduino software icon
Windows
Mac OS X
Select chip
The first step is to configure the Arduino software for the correct chip. Almost all Arduinos use the
ATmega168, but there's a chance you have an ATmega8. Look for the chip on the Arduino that looks like this:
If the text says ATMEGA8-16P then you have an atmega8 chip. If the text says ATMEGA168-20P then you
have an atmega168 chip. If it says "ATMEGA328P-20P" you have an atmega328p chip
Make sure the correct chip is selected (this picture is really old, will be fixed soon). This preference is saved so
you only have to set it once, the program will remember next time it's run.
Select port
Next, its time to configure the Serial Port (also known as the COM Port). Go back to lesson 0 to remind
yourself of which port it is. On a PC it will probably be something like COM3 or COM4. On a Mac it will be
something like tty.usbserial-xxxxx
Windows port selection
This preference is saved so you only have to set it once, the program will remember next time it's run.
However, if you have multiple Arduino's, they may be assigned difference COM ports. So every time you plug
in a new Arduino, double check that the correct port is selected.
If you have an NG Arduino, press the Reset Button now, just before you select the Upload menu item.
After a few seconds you should get this screen, with the message Done uploading. in the status bar.
If you get the following error message "avrdude: stk500_getsync(): not in sync: resp=0x00" that means that
the Arduino is not responding
Then check the following:
It means you dont have a serial port selected, go back and verify that the correct driver is installed (lesson 0)
and that you have the correct serial port selected in the menu.
If you get the following error Expected signature for ATMEGA
Then you have either the incorrect chip selected in the Tools menu or the wrong bootloader burned onto the
chip
If you get the following error: can't open device "COM10": The system cannot find the file
specified (under Windows, COM port value may vary)
It means that you have too many COM ports (maybe you've got 9 Arduinos?) You should make sure that the
port is numbered as low as possible. You can use a program like FTClean to clear out old COM ports you
aren't using anymore. Once you've cleaned out the ports, you'll have to reinstall the driver again (see lesson 0).
Alternately, if you're sure that the ports are not used for something else but are left over from other USB
devices, you can simply change the COM port using the Device Manager. Select the USB device in the
Device Manager, right click and select Properties
Then click Advanced... and in the next window change the COM port to something like COM4 or COM5.
Don't forget to select the new port name in the Arduino software. The lower port names may say (in use) but
as long as the other USB devices aren't plugged in, it shouldn't be a problem. This is a little riskier than just
using FTClean...
If you have a Diecimila or other Arduino with a built in LED you will see a translucent part as shown
If you have an NG rev C or other Arduino without an LED, the translucent part will not be there, and instead
you will see two silver dots
If you don't have an LED, you'll need to add your own. Any LED will do, as long as it has two legs and kinda
looks like the one shown here. LEDs are directional components. That means if you put it in backwards it will
not work! To help you put the LED in right, the LED factory cuts the legs at different lengths. The longer leg
goes in the hole marked 13 and the shorter one goes in the hole marked GND