Pages: [1]   Go Down
Author Topic: Arduino + Led Matrix + Bad Apple!!  (Read 1473 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've seen "Bad Apple!!" video ( ) and the wonderful stop motion version ( ), 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
« Last Edit: December 01, 2010, 11:20:56 am by blob » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 37
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
<?php
$image 
imagecreatefrompng($argv[1]);

for( 
$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;
            for( 
$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;
            &
#125;
            
echo chr($octet);
        &
#125;
    
&#125;
&#125;
?>

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.
Frederic
« Last Edit: December 01, 2010, 07:31:12 pm by blob » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

« Last Edit: December 05, 2010, 02:07:59 pm by focalist » Logged

When the testing is complete there will be... cake.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

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:
ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg

Frederic
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

incredible project.
Logged

Pages: [1]   Go Up
Jump to: