Python maps mouse movements on an LED matrix

[Vinod Stanur] is working with a mouse input and a microcontroller driven LED matrix. The mouse cursor is tracked inside of a window by Python and the resulting coordinates on the LED grid are illuminated. He calls it an LED matrix “Paint Toy” because one of the features he’s included lets the user create pixel art like in MS Paint.

The 10×8 grid of lights is controlled by a PIC 16F877A. This display orientation is perfect for the 8-bit controller, which uses an array of ten bytes to keep track of the pixel data. A computer running his Python application (which uses the Pygame module to track the mouse movements) communicates with the display board via an RF connection. Five bytes plus a stop character make up the communication packet. The first two bytes contain the coordinates of the cursor, the other three bytes contain mouse button status.

As you can see in the demo after the break, the system is very responsive. The mouse can be moved quickly without latency issues, and if the cursor leaves the tracking window it gets picked up right away when it re-enters.

Comments

  1. Mental2k says:

    It would be good if this were scaled down. You could swap out the LEDs for some pins and embed it in the top surface of the mouse. It would give a nice interface for low vision peeps. Combine it with some form of braille reader across the left mouse button (or right for lefties). Had the idea a few years ago. Never got round to it.

    • Whatnot says:

      Sounds so easy ‘swap out LED with pins” but how the hell are you going to actuate all those tiny pins?
      It is about time they brought out modules like that, it would be nice for many tactile projects, but so far it does not exist does it?

      But yeah micro mechanical needs more attention from the industry, people are already starting to bitch about the no-button smooth interfaces on smartphones and such, it starts to make people realize not ever feeling anything is a bit unnatural and irksome after a while.

      • Mental2k says:

        Oh I know, it’s the main reason I didn’t persue it any further. Perhaps a matrix of piezo electric “dots”, or maybe drive the print head of a dot matrix printer with a uc.

  2. A PIC is way more than powerful enough to speak PS/2; I’d love to see the whole thing implemented directly on the PIC with no computer at all.

  3. Mike bradley says:

    Not to be rude, but this is mis leading, this is just a PC pixel display, when you think about it, the PC just sends data to turn on/off an led.

    I agree with Christopher, ditch the PC

  4. supershwa says:

    We geeks spend so much time playing with testing our creations it’s a wonder we get anything done at all.

    ;)

  5. Eric Pavey says:

    Here’s another take: A while back I did something very similar using an Adruino, lolshield, and Python:

    http://www.akeric.com/blog/?page_id=1217

    This was a more simplistic approach than what was taken here (considering I used all off-the-shelf components), but the results are surprisingly alike.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,576 other followers