Arduino + Led Matrix + Bad Apple!!

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

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

<?php
$image = imagecreatefrompng($argv[1]);

for( $x_block = 0 ; $x_block < 3 ; $x_block++ ) {
    for( $x_pixel = 7 ; $x_pixel >= 0 ; $x_pixel-- ) {
        for( $y_block = 0 ; $y_block < 2 ; $y_block++ ) {
            $octet = 0;
            for( $y_pixel = 0 ; $y_pixel < 8 ; $y_pixel++ ) {
                $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.
Frederic