I very like the new mrlComm with sensor and servo regroup under a device structure. It will make it much more managable.

But i'm worrying about the memory usage

the default  inMoov hardware map have 10 servo and 5 sensors, so 15 "devices".

quickly looking at the device structure, each device will take about 70-80 bytes of memory

15 * 80 = 1200 bytes for all the devices.

compiling on the UNO, it say about 1350 bytes available. wich leave a very low amount of memory for the stack.

on the MEGA, there is plenty of memory available

 

So to have it work on UNO, we need to find a way to slash on memory usage to avoid strange behavior

 

I just found this that maybe could be use to monitor the "free" memory so the arduino could report to MRL when memory is low

https://learn.adafruit.com/memories-of-an-arduino/measuring-free-memory…

 

 

GroG

8 years 3 months ago

Excellent calamity !

I was just going to start looking for exactly what you reference in the link ! :D

I think sending back this info would be excellent good diagnostic information - currently we send back loadTiming events - which has been very valuable seeing where "time" is being spent.

It be great to see where and how memory is being spent during runtime.

Curious how you came up with ~80 .. I'd say its a good guess - but I did not see any documentation regarding memory size of an Arduino servo.

Even if we could "say" you can only use 8 servos with any stability on an Uno - it would be a win :)