Progmem will not compile on wifi1010

Please can somone help
This code will compile for a Arduino Mega But if i try to compile it for my wifi1010 it says
" const int*const index[] redeclared as different kind of symbol"

//index for gridParts                /=0,{=1,}=2,;=3,0=4,1=5,2=6,3=7,4=8,5=9,6=10,7=11,8=12,9=13,blank=14
const char gridParts[]PROGMEM = {'/', '{', '}', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',  ' '};
           
const int* const index[] PROGMEM = {5, 14, 1, 5, 0, 5, 0, 6, 0, 9, 3, 2, 6, 14, 1, 7, 0, 6, 0, 5, 0, 5, 3, 2, 7, 14, 1, 7, 0, 7, 0, 5, 0, 5, 3, 2, 8, 14, 1, 7, 0, 8, 0, 5, 0, 5, 3, 2, 9, 14, 1, 8, 0, 6, 0, 5, 0, 5, 3, 2, 10, 14, 1, 8, 0, 7, 0, 5, 0, 5, 3, 2
                                    , 11, 14, 1, 8, 0, 8, 0, 5, 0, 5, 3, 2, 12, 14, 1, 9, 0, 6, 0, 5, 0, 5, 3, 2, 13, 14, 1, 9, 0, 7, 0, 5, 0, 5, 3, 2, 5, 4, 1, 9, 0, 8, 0, 5, 0, 5, 3, 2, 5, 5, 1, 10, 0, 5, 0, 5, 0, 6, 3, 2, 5, 6, 1, 10, 0, 7, 0, 5, 0, 5, 3, 2,
                       
                                    5, 7, 1, 10, 0, 8, 0, 5, 0, 6, 3, 2, 5, 8, 1, 11, 0, 5, 0, 5, 0, 9, 3, 2, 5, 9, 1, 12, 0, 5, 0, 5, 0, 9, 3, 2, 5, 10, 1, 13, 0, 5, 0, 5, 0, 9, 3, 2
                                   };
                  
const char item[] PROGMEM = {".item"};
const char span[] PROGMEM = {"span "};
const char gridArea[] PROGMEM = {"grid-area:"};
const char* const string_table[] PROGMEM = {item, span, gridArea};
char gridChar;
char buffer[20];
void setup() {
  Serial.begin(9600);
}
void loop() {
  for (int a = 0; a < 16; a++) {
    String table;
    int c = 0;
    c = a;
    c *= 12;
    for (int b = 0; b < 12; b++) {
//this is looped through 16 times to go through the whole of index[] array
      int d = c + b;
      if (b == 0) {
        strcpy_P(buffer, (char*)pgm_read_word(&(string_table[0])));
        table += buffer;
      }
      if (b == 3) {
        strcpy_P(buffer, (char*)pgm_read_word(&(string_table[2])));
        table += buffer;
      }
      int number = pgm_read_word_near(index + d);
      gridChar = pgm_read_byte_near(gridParts + number);
      table += gridChar;
      if (b == 6 || b == 8) {
        strcpy_P(buffer, (char*)pgm_read_word(&(string_table[1])));
        table += buffer;
      }
      delay(100);
    }
    Serial.println(table);
  }
  while (1);
//.item1 {grid-area:1/1/span 2/span 5;}
//through to
//.item16{grid-area:9/1/span 1/span 5;}
}

Thats because SamD boards like the wifi1010 do not use "Progmem" it doesn't need it.
You can simply remove all Progmem code.
EDIT: Ok it may not be that simple but it is what must happen to solve this problem.

Thank you for your reply
i have removed all Progmem , but it still will not compile
It still cmpiles on a Mega but not the Mkr wifi1010.`

//index for gridParts                /=0,{=1,}=2,;=3,0=4,1=5,2=6,3=7,4=8,5=9,6=10,7=11,8=12,9=13,blank=14
char gridParts[] = {'/', '{', '}', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',  ' '};
int  index[]  = {5, 14, 1, 5, 0, 5, 0, 6, 0, 9, 3, 2, 6, 14, 1, 7, 0, 6, 0, 5, 0, 5, 3, 2, 7, 14, 1, 7, 0, 7, 0, 5, 0, 5, 3, 2, 8, 14, 1, 7, 0, 8, 0, 5, 0, 5, 3, 2, 9, 14, 1, 8, 0, 6, 0, 5, 0, 5, 3, 2, 10, 14, 1, 8, 0, 7, 0, 5, 0, 5, 3, 2, 11, 14, 1, 8, 0, 8, 0, 5, 0, 5, 3, 2, 12, 14, 1, 9, 0, 6, 0, 5, 0, 5, 3, 2, 13, 14, 1, 9, 0, 7, 0, 5, 0, 5, 3, 2, 5, 4, 1, 9, 0, 8, 0, 5, 0, 5, 3, 2, 5, 5, 1, 10, 0, 5, 0, 5, 0, 6, 3, 2, 5, 6, 1, 10, 0, 7, 0, 5, 0, 5, 3, 2, 5, 7, 1, 10, 0, 8, 0, 5, 0, 6, 3, 2, 5, 8, 1, 11, 0, 5, 0, 5, 0, 9, 3, 2, 5, 9, 1, 12, 0, 5, 0, 5, 0, 9, 3, 2, 5, 10, 1, 13, 0, 5, 0, 5, 0, 9, 3, 2};

char item[]  = ".item";
char span[]  = "span ";
char gridArea[]  = "grid-area:";
//char* const string_table[]  = {item, span, gridArea};
//char gridChar;
//char buffer[20];
void setup() {
  Serial.begin(9600);

}

void loop() {
  for (int a = 0; a < 16; a++) {
    //String table;
    int c = 0;
    c = a;
    c *= 12;
    for (int b = 0; b < 12; b++) {
      int d = c + b;
      if (b == 0) {
        for (int e = 0; e < 6; e++) {
          Serial.print (item[e]);
        }
      }
      if (b == 3) {
        for ( int f = 0; f < 11; f++) {
          Serial.print(gridArea[f]);
        }
      }
      int number = index[d];
      char gridChar = gridParts  [number];
      Serial.print(gridChar);
      if (b == 6 || b == 8) {
        for (int g = 0; g < 6; g++) {
          Serial.print(span[g]);
        }
      }
      delay(100);
    }
    Serial.println();
  }
  while (1);

}

the error message is
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino MKR WiFi 1010"

PROGMEM_FOR_LOOPS_jul27a:3:12: error: 'int index []' redeclared as different kind of symbol

int index[] = {5, 14, 1, 5, 0, 5, 0, 6, 0, 9, 3, 2, 6, 14, 1, 7, 0, 6, 0, 5, 0, 5, 3, 2, 7, 14, 1, 7, 0, 7, 0, 5, 0, 5, 3, 2, 8, 14, 1, 7, 0, 8, 0, 5, 0, 5, 3, 2, 9, 14, 1, 8, 0, 6, 0, 5, 0, 5, 3, 2, 10, 14, 1, 8, 0, 7, 0, 5, 0, 5, 3, 2, 11, 14, 1, 8, 0, 8, 0, 5, 0, 5, 3, 2, 12, 14, 1, 9, 0, 6, 0, 5, 0, 5, 3, 2, 13, 14, 1, 9, 0, 7, 0, 5, 0, 5, 3, 2, 5, 4, 1, 9, 0, 8, 0, 5, 0, 5, 3, 2, 5, 5, 1, 10, 0, 5, 0, 5, 0, 6, 3, 2, 5, 6, 1, 10, 0, 7, 0, 5, 0, 5, 3, 2, 5, 7, 1, 10, 0, 8, 0, 5, 0, 6, 3, 2, 5, 8, 1, 11, 0, 5, 0, 5, 0, 9, 3, 2, 5, 9, 1, 12, 0, 5, 0, 5, 0, 9, 3, 2, 5, 10, 1, 13, 0, 5, 0, 5, 0, 9, 3, 2};

        ^

In file included from c:\users\chris\documents\arduinodata\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\string.h:24:0,

             from C:\Users\chris\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.13\cores\arduino/api/String.h:28,

             from C:\Users\chris\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.13\cores\arduino/api/IPAddress.h:24,

             from C:\Users\chris\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.13\cores\arduino/api/ArduinoAPI.h:30,

             from C:\Users\chris\Documents\ArduinoData\packages\arduino\hardware\samd\1.8.13\cores\arduino/Arduino.h:23,

             from sketch\PROGMEM_FOR_LOOPS_jul27a.ino.cpp:1:

c:\users\chris\documents\arduinodata\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\strings.h:64:7: note: previous declaration 'char* index(const char*, int)'

char *index(const char , int) __pure; / LEGACY */

   ^~~~~

C:\Users\chris\Documents\PROGMEM_FOR_LOOPS_jul27a\PROGMEM_FOR_LOOPS_jul27a.ino: In function 'void loop()':

C:\Users\chris\Documents\PROGMEM_FOR_LOOPS_jul27a\PROGMEM_FOR_LOOPS_jul27a.ino:34:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]

   int number = index[d];

                       ^

PROGMEM_FOR_LOOPS_jul27a:34:27: error: invalid conversion from 'char* ()(const char, int)' to 'int' [-fpermissive]

exit status 1

'int index []' redeclared as different kind of symbol

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

All solved

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.