Another PROGMEM question. How to read string in a procedure ?

Hi I am also still struggling with ProgMem. I want to store multiple arrays with text strings to write to an LCD. I would like to call and write the strings from within a procedure WriteStringfromPROGMEM.

But I get this error message from the compiler: "cannot convert 'const char** to 'char*' for argument '3' to 'void WriteStringfromPROGMEM(byte,byte,char*,byte)'

I read many postings abbout pointers and content, but I still cannot figure it out.

Below just a small part of my code that shows the problem area:

prog_char Lead[] PROGMEM = " Lead"; prog_char NiCd[] PROGMEM = " NiCd"; prog_char NiMH[] PROGMEM = " NiMH"; PROGMEM const char *BattTypeTxt[] = {Lead,NiCd,NiMH};

prog_char Setup[] PROGMEM = " SETUP "; prog_char Stopped[] PROGMEM = "STOPPED"; prog_char Running[] PROGMEM = "RUNNING"; prog_char Done[] PROGMEM = " DONE "; PROGMEM const char *RunStateTxt[] = {Setup, Stopped, Running, Done};

void WriteStringfromPROGMEM(byte Col, byte Row, char StringTable, byte StringNumber) { char stringbuffer[20]; strcpy_P(stringbuffer, (char)pgm_read_word(&(StringTable[StringNumber]))); lcd.setCursor(Col,Row); lcd.print(stringbuffer); return; }

void setup() { byte BattType = 1; byte RunState = 2; } void loop() { ...... WriteStringfromPROGMEM(5, 0, BattTypeTxt, BattType); // write string number BattType of BattTypeTxt array at column 5 and row 0 WriteStringfromPROGMEM(0, 1, RunStateTxt, RunState); // write string number RunState of RunStateTxt array at column 0 and row 1 ...... }

Hi You seem to be passing a pointer to a pointer. Think you need to pass the address of the pointer:

WriteStringfromPROGMEM(5, 0, &BattTypeTxt, BattType); // write string number BattType of BattTypeTxt array at column 5 and row 0.

Ill have another look in the morning lol

cheers