SMILEY’S WORKSHOP ☺
style numbered pins to
do input from an eight-bit DIP switch, and
output that state to
eight LEDs. The
illustrations for the
Butterfly had both the
pin numbers and the
port/pin numbers, but
since the Arduino
figures did not have the
ports shown, we’ll use
Figure 7 which shows
the port pin numbers
with Px for the port
followed by the pin
number. For example,
PD5 is PORTD pin 5. In
Figure 8, we see how
the Arduino pins relate
to the ATmega328
port/pins.
As usual, I’ve been
having so much fun I
wasn’t paying attention to the time. It looks late and long,
so let’s put the code in avrtoolbox at http://code.google.
com/p/avrtoolbox/avr_applications/
simple_chaser_lights. Note that the
hardware to do the chaser light
project (as shown in Figures 9 and
10) with either the Arduino or the
Butterfly is available from the article
link. Refer to last month’s Workshop
for more details on how these are
wired.
■ FIGURE 9. Chaser lights using
the AVR Butterfly.
■ FIGURE 10. Chaser lights using
the Arduino board.
can purchase my C Programming book and Butterfly
projects kit at www.nutsvolts.com. NV
;;; ;;;;
www.canakit.com
Cana Kit
;;; ;;;
Final Thoughts
Questions? As usual, if you want
to be helpful when you find a
problem or have a question you’ll
need to put on your biohazard suit
and start a thread on www.avr
freaks.net with the word ‘avrtoolbox’
in the title (I probably will see it).
Read my blog entry first, that will tell
you why you need the biohazard suit
at http://smileymicros.com/blog/
2011/01/24/using-an-internet-forum.
Next month, we will finish up
AVR Digital I/O where — if all goes
well — I’ll apply it to a
breadboardable LCD and keypad
project.
If you just can’t wait and want to
get a leg up on all this serial stuff and
real C programming for the AVR, you
USB-LOGIC
;;;; ;;;;;; ;;;;;;;;
;;;;;;;;;;;;; ;;;;;;;; ;;;;;;;;;;;;
DSO-NANO-V2
ASSEMBLED
;;; ;;;
;;; ;;;
;;;;;;;; ;;;; ;;;;;;;; ;;;
ARDUINO-STK
;;; ;;;;;;;;;;;;; ; ;;;;;;; ; ;;;;;; ;;;;;;;;;; ; ;;;;;; ;;;;;;;;;;;; ; ; ; ; ;; ;;;;;;; ;;;;;;;
;;;;;;; ;;;; ;;;;;; ;;;;;;;;;;; ;;;;;
;;;;;;;;;; ;;;;;;;;;;;;;;; ;;;;;;;;;
UK1104
November 2011 53