Inertial sensor not returning correct values?

Hello everyone who reads this post. Our current inertial sensor is initialized in the code, and we use the following line in the while(true) loop in opcontrol:
pros::lcd::print(7, “%d”, (imu.get_rotation());
but this is the result:
https://drive.google.com/file/d/1FyfS0_JIbwftLHSdvFNYHXl6TMOT_uJq/view?usp=drivesdk

The correct values appear on the brain by clicking the inertial sensor but we can’t seem to get it to print onto the brain. Any advice is appreciated.

I’m pretty sure imu.get_rotation() returns a float, not an int. you should change your print statement to

pros::lcd::print(7, "%f", imu.get_rotation());
3 Likes

Thank you. I never would have caught that! I’ll try it out when I get the chance