Multiple Peggy2s showing serial video
December 18, 2009
[youtube http://www.youtube.com/watch?v=-ImjfHxXGfc&hl=en_GB&fs=1&]
So I’ve been working in every spare second for the last 48 hours to get my LED sign board built and part of the project was to have it showing live Twitter feeds. Standing on the shoulders of Mr. Clegg and Mr. Oskay, this proved to be a relatively simple task.
I built my first Peggy 2 in about 5 hours and then started fiddling to get the Processing video working and within no time I could write static messages on the board. The next setup was to make it work with two Peggy2s. Since I only had a few LEDs left over from the first, but a about 75 left over from making these for our wedding, I recycled them into the second Peggy so I could start coding and see some kind of result if my code worked successfully.
I wired up the two peggys in paralell via a breadboard to the Arduino and started modifying code.
The code changes were actually quite simple, I made a second header and data array so that the second Peggy2 has a different header that it acts on to change it’s state and then coded that into the sketch for the second Peggy2. I looked at changing the TWI address first but I think the Arduino code would need to be modified for that and right now it just spews data without modification and I didn’t want to mess with that yet.
I made the image 400×200 instead of square and then I made the renderToPeggy function loop through each array of 25×25 independently and send out each header and each chunk of data. That was all it took and now each Peggy2 acts on it’s own data and shows it’s own pixels though both are receiving data for the other. (This could probably be more efficient but I wanted it to work right away.)
I wrote a simple PHP script to gobble up tweets that I was interested in by following the API guide to search and dump them into a database. Then another PHP script to distribute un-seen tweets via a URL and then modified the Processing code to ask for a new tweet after one has been displayed. If there’s nothing new the code just shows a random tweet from the last 10 in the database.
Next steps in the project are;
- get the rest of the LEDs for the second Peggy2
- put both Peggys in some kind of a case, possibly with a coloured insert in front of the LEDs
add the ability in the Processing code to show a logo or many logos between tweets
Please can you share some pictures of the parallel wiring and the code ?
That would be awesome
Any chance of posting the wiring and code ? :D
Thanks in adv
Leave a Reply