Computer Controlled LEDs

CLICK HERE FOR AN MPEG MOVIE

This little experiment is proof to myself that I can control tons of LEDs using a shift register. That way the computer (probably the user-port on my C64) will only need to control 2 wires. One for clock, one for data. Most of the LEDs will be part of the lighting effect of the warp engines on my shuttlecraft. I'm hoping to construct something such as a bunch of 2-liter coke bottles slightly painted with LEDs inside. Then have approximatly 8 to 16 (depending how many I can fit) of these contraptions inside the warp nacells. Each bottle will light up seperatly. So it will be a pretty big light show controlled by these little shift registers. In the particular experiment you see here, I've just constructed it on a breadboard. Originally I was going to use 3 wires, so the computer could control the reset line on the shift register. Later I decided it wasn't really neccessary to be that accurate for this purpose.

From the software side, I wrote a program that runs on the commodore 64's interrupt service routine. So, in essence, it runs in the background. Which is cool because I can be working on other stuff and my main shuttlecraft program won't have to worry about keeping up the multitasking and timing of the LEDs. I designed the routine to be adjustable on speed and the type of pattern it displays. You can POKE to two different memory locations to change this. Although I'm currently using the user-port to control this I may later move control to the cassette port or joystick port. And there is still some chance I may end up using a Commodore-DTV to run the LEDs, which would mean I have to use the joystick lines.

Currently, you'll notice that I'm running the negative side of the LEDs through the shift register. The reason for this is that these chips can sink more miliamps through a low than a high. So from a software perspective, the LEDs act opposite than you would think. Sending a 1 turns the light off, and a zero turns it on. But for the real application on my shuttlecraft I'll need to run much more current and will have to reverse it around the other way and add some amplifying transistors to the design. Also I may daisy-chain another shift-register to the output of this shift-register so that I can control 16 lights with the same signal.



Back to main page