O'Reilly logo

Beginning Arduino by Michael McRoberts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Project 20 – LED Dot Matrix Display – Scrolling Sprite

You're going to use the same circuit, but with a slight variation in the code to create a multi-frame animation that also scrolls from right to left. In doing so, you will be introduced to the concept of multi-dimensional arrays. You'll also learn a little trick to get bitwise rotation (or circular shift). To start, you'll use the exact same circuit as in Project 19.

Enter the Code

Enter and upload the code in Listing 7-2.

Listing 7-2. Code for Project 20

// Project 20 #include <TimerOne.h> int latchPin = 8; //Pin connected to Pin 12 of 74HC595 (Latch) int clockPin = 12; //Pin connected to Pin 11 of 74HC595 (Clock) int dataPin = 11; //Pin connected to Pin 14 of 74HC595 (Data) byte frame ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required