(I got a Python/Perl background, where nobody cares about memory management - except the developers of the languages.)
In the course of my sketch, I assign variables both primitive and complex (objects) values. The most common situation is as follows:
void loop()
{
// ...
SerialTuple request = SerialManager::receiveTuple();
if(request.type == 1 and request.reference == 2)
{
int motorSpeed = request.getIntDataAtPos(0);
// processing 'motorSpeed'
};
// both 'request' and 'motorSpeed' will not be needed further
// ...
};
After some seconds, LEDs for RX, TX and on PIN 13 light up and the Arduino won't react anymore.
So how do I destruct, delete (or whatever one calls it) variables and free memory again?
Thanks
Christoph