SMILEY’S WORKSHOP ☺
avrdude -p m328p -c avrisp -P com6 -b 57600 -F -
// load PORTB pins into value
value = PINB;
// shift the value left 3 positions
PORTD = (value << 3);
//Serial.print(“value = “);
printf(“value = %d\n”,value);
We have now shown all the components for the
Cylon Optometry, but we’ve run out off space, so the
final source code that provides the blink patterns is in the
Workshop12 Sourcecode.zip file under /ACW/Cylon
Optometry ACW/ and /TAW/Cylon Optometery TAW/.
Remember, this is a repeat of some concepts from
Workshop 5, so you may want to refer back to that if all
this seems a bit rushed. NV
Change directories with:
cd \ALP DIPLEDSerial\default
Upload code with:
You can find the source code and
supplements for this article in
Workshop12.zip on the Nuts&
Volts and Smiley Micros websites.
The Newest Products and
Technologies are Only a Click
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
• Blink eight LEDs (Cylon Eyes).
• Read a pushbutton and eight-bit DIP
• 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.
• Over A Million Products Online
• More Than 390 Manufacturers
• Easy Online Ordering
• No Minimum Order
• Fast Delivery, Same-day Shipping
The Newest Products
For Your Newest Designs
Mouser and Mouser Electronics are registered trademarks of Mouser Electronics, Inc. Other products, logos, and
company names mentioned herein, may be trademarks of their respective owners.
July 2009 29