Greetings,
How can i create a interruption on the code and break a big loop?
i.e in my quadruped robot, i have sensors(gyro and accelerometer) for measure the stability of robot base, when there is a destabilization in the robot movement i need to break fastly the current movement and execute a posture correction. but the code with do the robot movement pattern is extensive and if possible i would not like to put many conditionals 'if' on the middle.
Thanks you.
Interruption on the code
Re: Interruption on the code
It's difficult to answer without examining some actual code.
Perhaps try to put your main code inside a function, so that you can easily exit from it with a "return" statement in the code.
Perhaps try to put your main code inside a function, so that you can easily exit from it with a "return" statement in the code.