Array of bytes in PROGMEM

this is my first post here :slight_smile: 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() {

typedef struct  {
  String charName;
  byte charBytes[8];
} CustomCharacter;

static const CustomCharacter mxlChr[] PROGMEM = {

void writeCustomChar(int c) {  
    for(int r=0; r<8; r++){
      byte lcdrow = pgm_read_byte(mxlChr[c].charBytes[r]);
      //byte lcdrow = mxlChr[c].charBytes[r];


void loop() { 
  for(int c=0; c<7; c++){

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!

This doesn’t show anything in the serial monitor.
Where is the & in byte lcdrow = pgm_read_byte(mxlChr

This however, does.
byte lcdrow = pgm_read_byte(&mxlChr[c].charBytes[r]);

If you want to see exactly what you’re getting, you can do this.
Serial.println(lcdrow, BIN); // this will show the value in binary and it should also match what you have in the array.**

Thank you for the reply.
I am still fighting with this. Eventually i made the code without using progmem , its working, but eventually i will run out of memory and will need to find ugly alternate ways to avoid that (like dividing the functionality over two arduinos)

If anyone could tell me how i can actually use PROGMEM in the above example , it would be absolutely awesome. The way you sugested HazardMinds is showing on serial "0" but does nothing useful. I tried various other ways in the meantime and i didn't get anything better.

Basically what i want to do is access a structures values that are stored in progmem

Thank you a lot

Please post your new code and your attempt to solve the issue in your first code.