hi folks!
im using a Sparkun serial lcd graphic display. I can print sprites on it doing something like this
byte mysprite[]={0x00,0x23,0xF1..........,0x00}
for(x = 0; x < length; x++) {
MySerial.write(mysprite[x]);
}
at this point i found a little noisy sprite issues, i think they are related to the how i use pointers, not a big deal...
im using BMP2ASM to convert BMP sprites into hexadecimal arrays very well.
because i use a lot of sprites in my proyect, im using a arduino ethernet (not uno, not shield) they have a sd port to load the hex arrays from a sd card, i write this:
int sprite_file="01.hex";
myspritefile= SD.open(sprite_file, FILE_READ);
if(myspritefile){
while (myspritefile.available()){
MySerial.write(myspritefile.read());
}
disco.close();
}
and to create the 00.hex files i write a little php code that write files in hex for me
<?php
$hex_sprite="0x00,0x00,0x00,0x00,0x00,0x00";
ASM2HEX("00.hex",$hex[0]);
function ASM2HEX($file,$data){
$ascii=explode(",",$data);
foreach ($ascii as $pos => $val){
$exploited=explode("x", $val);
$ascii[$pos]=$exploited[1];
$hexa.=$exploited[1];
}
$file_put=file_put_contents($file,pack("H*",$hexa));
}
?>
basically, ASM2HEX function explodes the string into a array, and convert each item from this 0xXX into this XX, and write all array in hexa bytes into file. I checked the result in hexa editor and the values are the same of the original sprite.
But, when i test the example i get crap on my lcd screen!
i think i dont have the knowledge for do this for my own, i want some help here