Hello,
I have a project requiring large arrays to make animations out of >500 LED bulbs. I'm using an UNO and believe I'm running out of PROGMEM. Example array size is array[300][64], and looks like:
#include <avr/pgmspace.h>
const int animation1[300][64] PROGMEM = {
{ 0b00000100, 0b00000100, 0b00000000, 0b00000000, 0b00000111, 0b00000000, 0b10000000, 0b00000000, 0b11000000, 0b00001100, 0b11000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00000110, 0b00000000, 0b00000010, 0b00000000, 0b00000001, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00010000, 0b00000010, 0b00000000, 0b00000000, 0b00100000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b11000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00010000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00000000, 0b00000010, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b10000000, 0b0000000 },
{ 0b00000100, 0b00000100, 0b00000000, 0b00000000, 0b00001110, 0b00000000, 0b10000000, 0b00000000, 0b10000000, 0b00011000, 0b10000000, 0b00000000, 0b00000000, 0b01110000, 0b00000000, 0b10000000, 0b00000000, 0b00000100, 0b00000000, 0b00000100, 0b00000000, 0b00000011, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00100000, 0b00000001, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b10000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00010000, 0b00000000, 0b00000100, 0b00000000, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00000000, 0b00000000, 0b00110000, 0b00001001, 0b00000000, 0b00001000, 0b00000000, 0b0000000 },
{ 0b00100000, 0b00010000, 0b00010000, 0b00000000, 0b11000000, 0b00000000, 0b00000000, 0b00000011, 0b00000000, 0b10000100, 0b00000000, 0b00000011, 0b01001100, 0b00000000, 0b10001100, 0b00000000, 0b00000000, 0b01110000, 0b00000000, 0b00000000, 0b00000000, 0b00001000, 0b00010000, 0b00000000, 0b00000000, 0b00000000, 0b00000100, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b10000000, 0b00000000, 0b00000000, 0b00000000, 0b00110000, 0b00011000, 0b00000000, 0b01000000, 0b01000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00100000, 0b00000000, 0b00100111, 0b00000000, 0b10000000, 0b00000010, 0b00000000, 0b00000000, 0b00000000, 0b00100010, 0b00001000, 0b00000000, 0b00000010, 0b00000000, 0b0000000 }
// etc for 300 rows...
};
It will work with 9, sometimes 10 rows of data before the lights indicate memory issues. Can anyone provide guidance on:
- What can I do to compress this data?
- Is PROGMEM the best option for this? Will I need more flash memory in order to support such large arrays?
Thanks!