Arduino: Windows simulator of driving matrices of 8x8 LED arrays

Published by paul at 8:32 AM under Arduino | Example Code | LED matrix | LED Projects

It's been a couple of weeks since I've been able to play hands-on with electronics because I've been busy with client work and out-of-town traveling.

To continue satisfying my must-be-tinkering-with-something urges, I hit upon the idea of using some old Windows code I had lying around to allow me to program LED matrices, without the LED matrices or an Arduino. This means I can effectively be developing code for the Arduino while on the road (we travel around 50% of the year seeing our clients around the world). The old code was for a life simulator (creatures running around fighting, breeding, etc) but it had all the code to display a bitmap on screen and update it already worked out. I figured that I could use it to simulate an 8x8 LED matrix - so off I went.

What it turned into is a couple of classes that simulate a maze and an 8x8, 16x16, or 32x32 LED display. I thought the code would be useful to a bunch of you so I've zipped it up for you to download and play with. The cool thing is that I can work on the maze processing code while on the road and then come home and drop it into the Arduino environment to compile and use. As long as I have LED matrix driving code on the Arduino, it should work like a charm.

Here's a screenshot of the simulator running:


Black 'dots' are on LEDs, spaces are off LEDs, the lighter colored dot is supposed to be a different color LED to represent a person. The simulator can switch between 8x8, 16x16, and 32x32 displays by pressing the Page Up and Page Down keys. Movement is through the arrow keys. The display mode can either be static with screen changes when the person crosses a window border (i.e. the person moves around on the screen) or scrolling, where the person stays still and the maze moves around. Pressing S switches between the two modes.

The code is in a zip file: Maze021710.zip (12.1k) and I've been using VS 2005 Professional to develop and debug.

There are plenty of comments in the code and I'm happy to answer questions about it.


[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Currently rated 1.7 by 123 people

  • Currently 1.731706/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

E-mail | Permalink | Trackback | Post RSSRSS comment feed 0 Responses


Kit building: Hansen Hobbies mini-scrolling LED sign kit

Published by paul at 2:30 PM under Kit Building | LED matrix

Over the weekend I found some time to solder together a kit that I'd picked up before getting stuck into the Arduino. It's the mini-scrolling LED sign kit from Hansen Hobbies and seems to be the only non-RC kit they make. It's a really nice kit that's fun to put together and at $40 it's not too expensive.

The finished kit produces an 24x8 red-LED display, using three 8x8 LED matrices. The LEDs are driven from the PIC16F628A microcontroller through three 74AC164 shift registers and eight PN2222A NPN transistors, with the transistors switching power to the rows of the matrices and the shift registers controlling the columns. The kit comes with comprehensive instructions and explanations of the circuit operation. Nicely done overall.

Here are some photos of the build process (click the image for a larger version):

1) The kit contents (I'd already started soldering when I realized I'd forgotten to take the initial photo)


2) Finished with passive components. One of the resistors broke so I substituted one I had lying around - can you guess which one? :-)


3) Finished with everything except the LED matrices. The components are packed in tight and the solder pads are very small - making for a few tricky soldering moments.


4) Everything in place. The LED matrices required some jiggling to get in - quite a few tiny movements to the pins with needle-nose pliers to get them to slot into the tiny through-holes. The PCB is very well put together with the shift register ICs on the underside from everything else to save space.


Everything worked on the first test! The four micro-tact switches control the editing of the message (all ASCII characters are there) and the message scrolling speed (8 speeds from stopped to blur). You can also connect the board up to a PC using RS232 or directly to another microcontroller - pretty neat.

The PIC is programmed with a 'well done' message that displays until you put in your own. Below is a video of the first one I entered (click to play).


Next up - using transistors with the Arduino to multiplex LED 10-bar arrays - eventually working up to designing and building my own scrolling sign using the Arduino, and beyond!

[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Currently rated 3.3 by 12 people

  • Currently 3.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

E-mail | Permalink | Trackback | Post RSSRSS comment feed 1 Responses