I use two simple libraries (see 1, 2) I found online for my code on the Arduino Uno, unfortunately I also use ROS and all those libraries take away to much space, when I compile my code I get this error:
Global variables use 2,112 bytes (103%) of dynamic memory, leaving -64 bytes for local variables. Maximum is 2,048 bytes.
I shortened my Strings, but it was not enough. How can I change the code in the libraries to achieve less used memory?
I think I don't understand the concept of global variables completely. For example I changed all double
variables in the libraries to float
variables, but it did not change dynamic memory use at all. How can I use less memory?
PID_ATune
which contains a lot of members, including an array of 100double
, i.e. 400 bytes for each instance ofPID_ATune
. Not sure so many double are needed there, but you could first try to reduce this number. – jfpoilpret Jan 8 '17 at 22:26