Hi, this is my first post, so be nice!
I've built an 40x8 led matrix using an Arduino Uno and some shift registers. The code works like a charm until i declare too many characters since the SRAM is pretty small. I figure i want to use PROGMEM for my character declarations, which is something i've never done before. I've been reading this post: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=38003&postdays=0&postorder=asc about the subject, but they don't use any examples simple enough for me (stupid ). My problem is that i don't know how to do a loop-search (is that the right term?) when storing in flash mem. I would very much appreciate if someone could help me with this!
My code:
#include <avr/pgmspace.h>
const char A[8][8] PROGMEM =
{
{0,0,0,0,0,0,0,0},
{0,0,0,1,1,0,0,0},
{0,0,1,1,1,1,0,0},
{0,1,1,0,0,1,1,0},
{0,1,1,0,0,1,1,0},
{0,1,1,1,1,1,1,0},
{0,1,1,0,0,1,1,0},
{0,1,1,0,0,1,1,0}
};
void loop()
{
char msg[] = "AAA";
//shitload of code//
char ch = msg[sign]; //sign is the variable that select character
switch (ch)
{
case 'A' :
{
if(A[t][place] == 1) // t and place select row and column
{
colSetHigh();
}
else
{
colSetLow();
}
break;
}
}
So in the switch-case, what should i do to be able to loop through the A-matrix?
regards Klas