I've wired up a dot matrix, and I display characters on the screen by using something like the example code below.
The Char_B
variable is a global variable in a library used by the Arduino, and displayPixels()
is called from inside the library.
bool Char_B[8][8] = {
{0,1,1,1,1,0,0,0},
{0,1,0,0,0,1,0,0},
{0,1,0,0,0,1,0,0},
{0,1,1,1,1,0,0,0},
{0,1,0,0,0,1,0,0},
{0,1,0,0,0,1,0,0},
{0,1,0,0,0,1,0,0},
{0,1,1,1,1,0,0,0}
};
displayPixels(1000, Char_B);
However, each time I declare a new character like the array above, I use a relatively massive amount of memory. Is there any way to reduce memory usage? Keep in mind I am willing to change the structure of the array if necessary, since I'll need well over 100 characters loaded onto the Arduino to write text.
I use a relatively massive amount of memory.
- 64 bytes, perhaps? You don't need 64 bytes to store 8 lots of 8 bits. You would need 8 bytes. – Nick Gammon♦ Feb 1 '16 at 8:26