Hello.
I'm using the MIDI library to send sysex to a computer, and also receive from it.
The function to send sysex(i'm not receiving yet) is
MIDI.sendSysEx (int length, const byte *const array, bool ArrayContainsBoundaries=false)
I have to create an array of bytes and send them with that function. I tried with a blank sketch and it worked. The array size is 1024 bytes.
I use it to make a backup of my EEPROM, i read the whole memory and send it through the sysex array. Then I use the same array when i want to receive from the computer, and write it to the EEPROM.
But my main sketch has 384 bytes of free RAM(i used MemoryFree library to measure it), so...
Then I remember I read about PROGMEM. But I didn't understand if I just create the array and write it with PROGMEM once, and only read from it while the sketch is running. Or if I can write/change the array multiple times while the sketch is looping?(this is what I need)
thanks
Well I think I found the answer in the tutorial section:
If you don't need to modify the strings or data while your sketch is running, you can store them in flash (program) memory instead of SRAM; to do this, use the PROGMEM keyword.
I'll have to make it in a different way. Maybe with a smaller array and send multiple sysex message with the array changing it's values and adding the F7 byte in the last sysex message...