Hi, I have a question regarding the sketch size. Namely I introduced only few PTL and out of sudden I don't have any more space and verify fails with too large error. Since I am a beginner I am not sure what is calculating the size so I removed most of the ifdef Developer checks , Printlines and comments in order to lower the size and I somehow managed it. Then I started playing with Nybble.ino and adding and altering and doing printlines mostly to figure it out how it is working and then again I run into same error - > no space. so I copy pasted version where I had space and then surprise -> no space....
I currently have 588 lines and almost no space. in this version I do not have a single printline entered by myself and no my functions.. pure petoi and then again no space.
Can you help me please and let me know what is exactly influencing the size and contributing to the error. I am really puzzled
If you want to temporarily gain some program memory space, you can set a compile directive to not use the gyros (see below). Of course doing so effectively puts the Nybble into turbo mode since the servos get more cpu cycles. If you want to use this trick a lot, you would need to throttle back the servos by e.g.:
[1] using more steps as is done in the behavior() function with speedRatio or
[2] using the same number of steps but with a pause after each (new code would be needed) or
[3] reduce the servo voltage (hardware fix).
Of these, I am planning to use approach [1].
Update: 2020-07-05
Since the behavior() function only works for poses and the need above is to throttle back the servos in gaits, approach [1] will currently not work for this purpose.
I think the simplest approach at present is to turn on the compile directive "#define SKIP 1" in Nybble.ino. See @Rongzhong Li's comment here. Of course, this doesn't provide fine speed control nor can you change the speed in real time (though the latter could be handled with some code changes, e.g. approach [2] above). BTW, changing SKIP to higher integer values will further slow the gait speed which can be handy for study of each frame in a gait!
Code Snip:
#ifdef USE_GYROS // set our DMP Ready flag so the main loop() function knows it's okay to use it PTLF("DMP ready!"); dmpReady = true; //TS dmpReady = false will disable the checkBodyMotion() function so the gyros will not be used and speed increases to turbo. Program memory consumption drops to 89% in my case. #endif