Function imu_tare_euler

Source
pub unsafe extern "C" fn imu_tare_euler(port: u8) -> i32
Expand description

Reset all 3 euler values of the Inertial Sensor to 0.

This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (1-21). ENODEV - The port cannot be configured as an Inertial Sensor EAGAIN - The sensor is still calibrating

\param port The V5 Inertial Sensor port number from 1-21 \return 1 if the operation was successful or PROS_ERR if the operation failed, setting errno.

\b Example \code #define IMU_PORT 1

void opcontrol() { while (true) { if(controller_get_digital(CONTROLLER_MASTER, E_CONTROLLER_DIGITAL_X)){ imu_tare_euler(IMU_PORT); } pros::delay(20); } } \endcode