I saw an example of someone doing marquee lights using *duino and 16 putput pins. I wanted to reproduce it using Gadgeteer, 3 pins, and a series of 74HC595s. Here it is: Marquee Lights using 74HC595 with Gadgeteer.
This uses the following components:
- FEZ Raptor
- 16 LEDs
- 2x 74HC595
- 200Ohm resistors
- A ton of wire
The setup looks like this:
Here is the video of it running:
The 74HC595 chips are 8-bit shift register chips. Using them requires a basic knowledge of bit shift operations. The bit operations are a much better substitute for an array of bool types which you’ll see elsewhere. The crux of the operation is to “shift in (or clock)” the high/low state of each pin. Once all 16 are in, you “latch” to enable to pins. It’s easy once you understand the process.
Gadgeteer and the .NET Micro Framework make this type of work very fun.
The meat of the code is in the timer.Tick method:
void runntimer_Tick(GT.Timer timer)
int copy = toDisplay;
for (int i = 0; i <= 15; i++)
int b = copy & 1;
if (b == 0)
copy = copy >> 1;
toDisplay = toDisplay >> 1;
The code can be viewed here:
As always, pull requests are encouraged.