Go Down

Topic: uVga, ascii art in PROGMEM array? (Read 609 times) previous topic - next topic


Hi y'all,

i've been playing with the uVGA module today, nice tool must say a bit buggy though...

well i start with writing a php script that converts an image to 80x25 and then returns the color codes in an array.
so i could easily use it with my Arduino and uVGA. this works quite nicely! :-)

this wouldn't work, i guessed i used to much memory, and then i read about PROGMEM, that's where i thought i'd better ask here before i continue wasting
the rest of the night...

what i want to do is to show a simple ascii image 80x25 with only the ascii 219 block character

so some pseudo code  just to get an idea:

Code: [Select]

int pixels_color_codes[] = {0,0,1,2,1,2,2,2,1,1,1,2 ..... etc etc};

for (i = 0; i < 2000; i++){

so how should i continue with this? or is this a bridge to far?


If you want to know how put something into PROGMEM at compile-time and use it at runtime, take a look at the Flash library

Also, in your code you use int for values with maximum 256 values. Use int8_t (or uint8_t if you don't need negative values). That halves your memory usage. If you have even fewer colours, you can use jsut the necessary number of bits and pack. Also, you could apply some compression to your images, even  a stupid running length encoding or some simple kind of dictionary compression will a help.


Go Up