// prints Hello World! with ending line break
// sets the LED on
delay(1000); // waits for a second
// sets the LED off
delay(1000); // waits for a second
This time, we will not copy the Arduino files; we will
use libACW001 (libACW001.a and libACW001.h are in
the Workshop11.zip). Using libraries was discussed in
Our Arduino Uses the ATmega328
Our Arduino Projects Kits has caused a little
confusion because it uses the Duemilanove (Italian for
2009) with the ATmega328 (double the memory at the
same price) instead of the older ATmega168. These
processors have 32 or 16 kilobytes of memory,
respectively, so they require a different setting in the
Arduino IDE. For our board, open the Tools/Boards menu
and select the Arduino w/ ATmega328. Also note that the
bootloader runs at 57600 baud, which is faster than the
older Arduino bootloader and seems to be confusing
some folks on the Arduino forum, so be careful.
‘Hello World!!!” with all three exclamation points
repeating once per second.
Now let’s do it again in ACW cookbook style:
• Create a new directory C:\Arduino ToAVRStudio - Hello
• Open AVRStudio and create a new project ‘Hello
World’ in C:\Arduino ToAVRStudio-Hello World. Creating
AVRStudio projects is described in Workshop 2. Be sure
and select the ATmega328p.
• Add the libACW001.a library and libACW001.h header
to the AVRStudio project (adding libraries was discussed
in Workshop 4.)
• Type in the above ‘Hello, World!’ in ACW source code.
• We use three exclamation points so that we can tell
we’ve uploaded this version – the TAW version shows
“Hello, World!”; the ACW version shows “Hello,
• The AVRStudio project is available in the
• Click the AVRStudio compile button.
Upload It with AVRDude
• Reread the directions for using AVRDude in Workshop
10 on how to open AVRDude and navigate to the
• Open Notepad and type:
cd \ArduinoToAVRStudio – Hello World\default
avrdude -p m328p -c avrisp -P com6 -b 57600 -F
• Copy and paste the first line into the cmd window and
hit enter to point it to the correct directory.
• Copy and paste the second line into the cmd window.
• Push the reset button on the Arduino and at the same
time click the enter button so that the cmd window will
• Open the port in your terminal and you should see
for this article in Workshop11.zip on the Nuts&Volts
and Smiley Micros websites.
Well that should get you started and yield a base
for your next weekend project. I am always curious to
see what readers
construct with the
knowledge offered here,
so if you build something
nifty please drop me
a note and share!
My website is at
micros.com/ and I always
welcome your feedback,
■ FIGURE 10. Hello World!
The Arduino Projects Kit
Smiley Micros and Nuts & Volts are selling a special
kit: The Arduino Projects Kit providing components for
use with Smiley’s Workshops 9, 10, 11, and many future
Workshops. Over time, we will learn simple ways to
use these components, and more importantly we will
use them to drill down into the deeper concepts of C
programming, AVR microcontroller architecture, and
embedded systems principles.
With the components in this kit you can:
• Blink eight LEDs (Cylon Eyes).
• Read a pushbutton and eight-bit DIP switch.
• Sense voltage, light, and temperature.
• Make music on a piezo element.
• Sense edges and gray levels.
• Optically isolate voltages.
• Fade an LED with PWM.
• Control motor speed.
• And more …
One final note: The USB serial port on the Arduino
uses the FTDI FT232R chip that was discussed in detail in
the article “The Serial Port is Dead, Long Live the Serial
Port’ by yours truly in the June 2008 issue of Nuts & Volts.
You can also get the book “Virtual Serial Programming
Cookbook” (also by yours truly) and an associated
projects kit from either Nuts & Volts or Smiley Micros.