Hi all, warning... TOTAL noob to Arduino coming from a Dynamically typed (PHP etc) background......
talking to an 8x8 LED Matrix which works fine and copied some sample code which procedurally goes through every sprite to draw to the matrix ...
sprites are defined ...
byte N1[] = {B00111000,B00111000,B00011000,B00011000,B00011000,B00011000,B00111100,B00111100};
....
byte N10[] = {B01111110,B01111110,B01100110,B01100110,B01100110,B01100110,B01111110,B01111110};
...etc
& I can procedurally draw each
drawScreen(N1);
drawScreen(N2);
...N3 N4 etc
but I want to stick the sprites in an array and iterate through them
in PHP I would... along the lines of...
$sprites=array('N10',N9','N8...etc);
foreach($sprites as $s){
drawScreen($s);
$delay+=100;
//etc
}
i understand that my sprites are declared as 'byte' and assume that thats what drawScreen expects and when iterating through an array of 'N1','N2' etc I am passing a char.
how do I convert 'N1', into the previously declared N1 required by drawScreen() ?
also, I am used to concatenating strings with '.' or '+' but I assume its not so simple in typed languages, e.g.
String mySprite=0;//'0'?
while (x < 10){
mySprite = 'N' + x;
drawScreen(mySprite);
//clearly will not work but how do I do this ?
}
Any help appreciated.