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.:
 using more steps as is done in the behavior() function with speedRatio or
 using the same number of steps but with a pause after each (new code would be needed) or
 reduce the servo voltage (hardware fix).
Of these, I am planning to use approach .
Since the behavior() function only works for poses and the need above is to throttle back the servos in gaits, approach  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  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!
Use latest arduimo IDE ~
I am curious about this very limited program storage space issue I keep seeing referred to in various posts, docs etc. Please excuse this question as I am a total newbie at this stuff and having somehow managed to actually get the Nybble assembled and basically working am, like yourself, wanting to get into the programming side. So my question is why is there so little storage capacity? I believe that there are Arduino boards available with signifcantly more storage space - maybe they are too big, require too much power? I am also curious about how much capability is possible with adding a Pi like you mentioned including more space for program code.
Is there any possibility to use other environment for coding and debugging such as VS Code or similar. Can you please explain what needs to be done there in order to import your board? I would like to have sort of step by step debugging possibilit. Not sure if this is possible with arduino or nybble board in general
Upload this code and try to understand how the code blocks are enabled or disabled.
Hi I deleted all ifdef Developer statements as well (additional Printlines, switches...) So this should not be the problem.Additionally developer is commented out just in case.
Can you tell me what is influencing this size. Is total number of lines and file size or loading active parts of the code in the memory? Or something else that I am not aware of?
Edit: Also can this be resolved by using RaspPi together with Petoi board?
will activate some debugging println that's unnecessary. You may comment the #define Developer out and add only the println you need in the program, rather than activate them all at once.