Home:ALL Converter>From PROGMEM to Flash Memory of Arduino

From PROGMEM to Flash Memory of Arduino

Ask Time:2014-02-19T01:13:30         Author:Glenn Posadas

Json Formatter

I am trying to get some help because I'm moving someone else's code (that uses a PROGMEM) to my Flash Memory...

Visit http://forum.arduino.cc/index.php?topic=218899.0

So, here are my questions: This is the original code segment:

prog_uint8_t Image[ImageColumns][LEDEights] PROGMEM = {{ 
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,     
B11111111  }
  , {
B11111111, B10110111, B10111001, B11111111, B11111111, B11111111, B11111111, B11111111,                 B11111111  }}; 

This is my revised code:

const int Image[ImageColumns][LEDEights] = {};

I tried to compile it using other's laptops, and then it wored actually, but I noticed and learned that PROGRAM is impossible for chainging outoutl. Is my revision correct?>?

I can't fully say that the whole code will work, because of this: (I know this has something to do with AVR-GCC bla bla bla progmem, right? I've read about it a while ago just for a minute.).

Code: prog_uint8_t imageEights = pgm_read_byte(&(Image[column][eight]));

If this won't work, how to read byte from SRAM then?

Author:Glenn Posadas,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/21860729/from-progmem-to-flash-memory-of-arduino
yy