In one Photon application I am using six char arrays, each of them being 610 characters long, for logging application data.
I want to clear those arrays (resetting all characters to ‘0’) every once and a while and I initiated the clearing process through a Particle.function that I activate from the Particle console.
The Particle function sets a variable CLEAR to ‘1’ and when CLEAR == 1 is detected within the loop(), all char arrays are “cleared”:
for (int m = 0; m < 610; m++)
chararray1[m] = 0;
chararray2[m] = 0;
chararray3[m] = 0;
This works fine, however I found out that this process is taking a lot of time: might be several seconds.
Of course these are rather long arrays, but I assume there must be an easier, quicker way to erase them all (or rather: reset them to ‘0’).