Go Down

Topic: Arduino + Led Matrix + Bad Apple!! (Read 2901 times) previous topic - next topic


Dec 01, 2010, 05:20 pm Last Edit: Dec 01, 2010, 05:20 pm by blob Reason: 1
I've seen "Bad Apple!!" video (http://www.youtube.com/watch?v=G3C-VevI36s) and the wonderful stop motion version (http://www.youtube.com/watch?v=240Vq6tIxio), and I wanted to make my own really small tribute with my really small Arduino and my really small led matrix ! ;-)

Here is the result, pretty simple.

- On Arduino : led matrix initialisation, waiting for incoming data over serial port and sending them on the display. I can't do easier ! Next version will be with SD card and 30fps synchronisation.

- On the computer : video resize (24x16), black&white, conversion to the led matrix display format. Music was added after the shoot, over the video.

Have fun with Arduino ! ;-)
Frederic, Strasbourg, France


Very cool, i would like to know how did you convert it to led matrix format?


Dec 02, 2010, 01:28 am Last Edit: Dec 02, 2010, 01:31 am by blob Reason: 1
Hi !

The problem with this matrix is that data is not written from top-left to bottom-write. You have to read 8 pixels blocks from left to right, but rows inside a block from right to left. Like if matrix was put upside down... :-(

Here is my PHP code (used in command line interface, and with 24x16 one bit PNG format) :

Code: [Select]

$x_block $x_block $x_block++ ) &#123;
for( $x_pixel $x_pixel >= $x_pixel-- ) &#123;
for( $y_block $y_block $y_block++ ) &#123;
$octet 0;
$y_pixel $y_pixel $y_pixel++ ) &#123;
$x = ($x_block*8)+$x_pixel;
$y = ($y_block*8)+$y_pixel;

$color imagecolorat($image$x$y);
$octet $octet*2;
$octet $octet+$color;
echo chr($octet);

PHP is returning data in the good way for the display. The Arduino have juste to copy incoming data to the led matrix.

I hope it will help you.


how did you send the data over? what was the data you sent over


Dec 05, 2010, 07:59 pm Last Edit: Dec 05, 2010, 08:07 pm by focalist Reason: 1
From what I see, I think he's sending the picture over in a straight bitmap.  He mentions that decoding is not done topleft to bottomright, his looping code (on the PC, done in PHP in the code he posted) takes care of that.  He's just using a serial connection, I think..  The Arduino is then displaying that bitmap on the LED grid.  24x16=384pixels.  One pixel per bit, so that's only 48 bytes for the full image, probably passed as just a stream of CHAR or BYTE values, 48 bytes long.  Serial handles that even at slow speeds.

Pretty good framerate.. now you need a way to produce the PNGs downconverted from uncompressed AVI frames... so that on one side you just feed in a video file and on the arduino, the best approximation is mapped on the LED matrix..



You're right. The computer do all the job and send data in the raw format for the display. I send bytes via serial port. Arduino just read each byte and send it to the display.

As I said, it's just for fun. Not a big work. But it was funny to learn how to display on this matrix.

I'll send Arduino's code here. I don't have it here. Sorry.

For AVI->image conversion, you can use for example ffmpeg (http://www.ffmpeg.org) :
Code: [Select]
ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg


Go Up