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.

[youtube=http://www.youtube.com/watch?v=EMq-896bv9Y&w=470]

8 thoughts on “Python Maps Mouse Movements On An LED Matrix

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

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

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

Leave a Reply to Christopher MitchellCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.