I am making a game on the Arduino with large maps stored in unsigned long datatype in two dimensional arrays.
I have tried to use the PROGMEM code to store and retrieve the map data; I cannot find out how to retrieve it but I was able to store it.
I really do not understand this PROGMEM code, but here is what I have so far:
#include <avr/pgmspace.h>
PROGMEM const prog_uint32_t MAPGreen[][97] = { //the maps in the game
{
0b11111111111111111111111111111111, 0b11111111111111111111111111111111,
0b10000000000000000000000000000000, 0b00000000000111111111111111111111,
0b10000000000000000000000000000000, 0b00000000000110000000000000000011,
0b10000000000000000000000000000000, 0b00000000000110000000000000000011,
0b10000000000000000000000000000000, 0b00000000000110000000011101110011
},
{0b10000000000000000000000000000000, 0b00000000000110000000011101110011,
0b10000000000000000000000000000000, 0b00000000000110000000010101010011,
0b10000000000000000000000000000000, 0b00000000000000000000000000000011,
0b10000000000000000000000000000000, 0b00000000000110000000000000000011,
0b10000000000000000000000000000000, 0b00000000000110000000010101010011,
},
};
note: there is a total of 97 numbers in each string in the full code, I just decided to spare you of the massive amount of binary data
What I do with this data is check every bit of every line with another value, so if it is possible to set it up to where that is possible, that would be great. If I have to add a step or two to be able to do it, that is fine too.