by Michael McRoberts

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required