Hello!
this is my first post here i hope i posted it in the right section.
I am a beginner with Arduino too
I am trying for two long days to learn how to store variables in PROGMEM and use them, but i can’t get this to work. The following example works fine if i remove PROGMEM and switch back to read the struct array directly.
How do i set it to read those bytes from PROGMEM right?
It compiles but read weird/wrong data
#include <avr/pgmspace.h>
#include "LedControl.h"
//DataIn, CLK, LOAD, single MAX72XX.
LedControl lc=LedControl(12,11,10,1);
void setup() {
 Serial.begin(9600);
 lc.shutdown(0,false);
 lc.setIntensity(0,8);
 lc.clearDisplay(0);
}
typedef struct {
 String charName;
 byte charBytes[8];
} CustomCharacter;
static const CustomCharacter mxlChr[] PROGMEM = {
{"smiley",{B01000010,B10100101,B10100101,B01000010,B00000000,B10000001,B01000010,B00111100}},//0
{"arrow_L",{0b00011000,0b00110000,0b01100000,0b11111111,0b11111111,0b01100000,0b00110000,0b00011000}},//1
{"arrow_R",{0b00011000,0b00001100,0b00000110,0b11111111,0b11111111,0b00000110,0b00001100,0b00011000}},//2
{"M",{B10000001,B11000011,B10100101,B10011001,B10000001,B10000001,B10000001,B10000001}},
{"A",{B00011000,B00100100,B01000010,B01000010,B01111110,B11000011,B10000001,B10000001}},
{"X",{B10000001,B01000010,B00100100,B00011000,B00011000,B00100100,B01000010,B10000001}},
{"sound",{B00001100,B00000010,B01001001,B11000101,B11000101,B01001001,B00000010,B00001100}},
};
void writeCustomChar(int c) {Â
  lc.clearDisplay(0);
  for(int r=0; r<8; r++){
   byte lcdrow = pgm_read_byte(mxlChr[c].charBytes[r]);
   Serial.println(lcdrow);
   //byte lcdrow = mxlChr[c].charBytes[r];
   lc.setColumn(0,r,lcdrow);
  }
}
//examples
//lc.setRow(0,row,B10100000);
//lc.setColumn(0,col,B10100000);
//lc.setLed(0,row,col,false);
void loop() {
 for(int c=0; c<7; c++){
  writeCustomChar(c);
  delay(1000);
 }
}
The purpose: I am trying to do a little code to write custom glyphs on a 8x8 led matrix, that i previously defined in that array, because nothing i found so far works so i decided to make my own.
…and also because i want to learn how to store large amounts of organized data.
Any advice or fix for this is most welcome
Thank you very much!