Hello,
I am working on a project that aims at playing signals that are made of quite a high number of values. They are arrays of 10000 values, values being pwm values, from 0 to 255. Each signal is in its own file.
My code works for up to about 6 signals, and then over that the analogWrite doesn't do anything anymore. If I print to Serial, the value is there, but the output doesn't output anything.
I suspect a memory issue but I am not sure why or how to fix it.
I use an arduino Mega.
Anyway, here is my code. If anyone has an idea why the analogWrite stops working after 6 signals or so. that would be of great help.
Cheers.
Ah I know this Problem. Had the same on my project... I cant Check your ino files since I am on mobile atm. So please Provider some Information. You save your 10.000 long array in progmem? If Not, your 8kb memory runs out ( 10k Byte array in 8kb memory...)
If you using progmem and pgm_read then you need to save your Arrays in proper sector, Else they override the System relevant parts of progmem and nothing works properly anymore.
One more Thing. Using arduino mega, you need pgm_read_far functions. Since pgm read is trimmed to 64kb and mega has 256kb.