SPIKE-RT C API Reference [English]
An RTOS-based software platform for LEGO® Education SPIKE™.
Functions
IMU

API for the hub built-in IMU. More...

Functions

pbio_error_t hub_imu_init (void)
 Initialize the IMU driver. More...
 
void hub_imu_get_acceleration (float accel[3])
 Get the acceleration by the IMU. More...
 
void hub_imu_get_angular_velocity (float angv[3])
 Get the angular velocity by the IMU. More...
 
float hub_imu_get_temperature (void)
 Get the temperature by the IMU. More...
 

Detailed Description

API for the hub built-in IMU.

Function Documentation

◆ hub_imu_get_acceleration()

void hub_imu_get_acceleration ( float  accel[3])

Get the acceleration by the IMU.

Parameters
accelFloat array to store the x/y/z axes acceleration[mm/s^2].

◆ hub_imu_get_angular_velocity()

void hub_imu_get_angular_velocity ( float  angv[3])

Get the angular velocity by the IMU.

Parameters
angvFloat array to store the x/y/z axes angular velocity [°/s].

◆ hub_imu_get_temperature()

float hub_imu_get_temperature ( void  )

Get the temperature by the IMU.

Return values
Temperature[℃].

◆ hub_imu_init()

pbio_error_t hub_imu_init ( void  )

Initialize the IMU driver.

Return values
PBIO_SUCCESSSuccessfully initialized.
PBIO_ERROR_FAILEDFailed to initialized.