Inertial Sensor Code Not Working

Just wondering if anyone can help out. We have the inertial sensor and when we try running the code it will run continuously in place rotating around. I am not sure if we have to set the sensor value to zero in the beginning if so how would we do that. If anyone can help that would be amazing.

You have to calibrate the sensor (for about 2 seconds) before running your code. And make sure after your while loop, you motors are set to coast. Posting your code will help with finding the answer

2 Likes

Capture

is the robot rotating the correct way ? clockwise ?

2 Likes

Well in that code it was not running clockwise, and I just realized that, but when I changed the motors to rotate in the correct direction it still does the same thing.

how are you calling the function ? What value is motion ? perhaps add some statements to print values to the brain screen or terminal to help debug.

2 Likes

I am calling for the function “bruh”, and the value for motion is 90. simply written

bruh(90);

Also, please, ensure that you are not going to call vexcodeInit() and Inertial14.calibrate() more then once per program.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.