How do I set up the heading for an Inertial Sensor?

I want tu use a Inertial sensor for my auton, but I don’t know haow to calibrate the heading, or how to really use it. Can someone please send an example? Also, if I use a turn function using Motorname.spin along with waitUntil((Inert.rotation(degrees) >= degTurn));, does it do a turn realtive to my current positon or the heading?

Please, take a look at these examples:

Let us know if you could get started initializing and using inertial sensor. After you you do, the next step would be to add PID to control your turns using inertial sensor as the input.

Yes rotation() is the correct function to call, you just need to remember its initial value before entering PID loop (see example here).

Even more information here: Inertial sensor programming

5 Likes