NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » PROGMEM attribute ignored warning

July 19, 2010
by joel
joel's Avatar

can anyone help me to determine why i get progmem attribute ignored warning. I was tying to generate some code for the led array project to scroll text with out the computer.i can get it to work if i let the text reside in ram.when i try to put it in flash it gives this warning.the progmem operates ok in the font.h file as it is put in flash at lower addresses.Below is my code

void mysimplescroll(){
ledarray_blank();
int8_t offset = 0;
 uint8_t i,s,con=0; 
  const char  PROGMEM string1[]  = "MELLISA";

  //char c[8];
  char x =' ';
  //c[0] ='M';
 //c[1] ='E';
 //c[2] ='L';
 //c[3] ='I';
 //c[4] ='S';
 //c[5] ='S';
  //c[6] ='A';
 //c[7] =' ';

 //s = sizeof(string1);// sizeof(char);

 while(1) {
   for (i=0;i<(3);i++){

         x =pgm_read_byte(&(string1[i]));

   for(con=0;con<(font_width(x)+1);con++){
   offset = COLS-1-con;
   delay_ms(125);
   ledarray_left_shift();
    font_display(x,offset);
    }

        }
        }
         }

I am running windows 7 64 bit system and using the make file and programmers notepad in the led array kit to compile code.

thanks a bunch

July 21, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi joel,

I think you are getting this error because you are trying to declare a static string into program memory in the middle of a method. This is inherently a strange thing to do because things inside methods should be evaluated a runtime. Place your static stings outside of any method (they are typically placed right after the include statements), and I think that will solve your problem.

Humberto

July 25, 2010
by joel
joel's Avatar

thanks Humberto,that did solve my problem. Joel

Post a Reply

Please log in to post a reply.

Did you know that a piezoelectric buzzer can be used to play music with your microcontroller? Learn more...