I started using an ultrasonic sensor to detect the height of loads of cones in front of it by moving up and down.
However, the sensor isn’t working every time, I mean, work after a few tries.
I have to start with something hanging 6cm in front of the sonar. After I remove it by user-control, the value of sensor was like locked at 6, and it doesn’t change no matter what. I have to cover the input and output by finger, giving a -1 value, then remove and it will work as normal.
But this move is certainly not allowed in competition during pre-auton.
Is there some kind of solution by initialising or restarting?