Where to place sensors measurement output in the code?
Hi, I'm trying to develop an obstacle avoidance feature for the XboxController program I made. The first step is adding the distance measurement function in the code (I'm using Grove ultrasonic sensor); I placed it within the loop function, after GYRO calculations:

But it makes Bittle unable to walk (it moves its limbs just a little bit and very slowly) so I think thats not the best place to place the code; where should I put the sensors output to avoid influencing Bittle behaviour and movement?
Got any tips for using sensors? such as how much delay to use, how to send through serial properly...
72 Views
A good suggestion. We'll make it better.