We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-03-20
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 4295 times
Not followed.
License: MIT license
6DOF IMU 4 Click is an advanced 6-axis motion tracking Click board, which utilizes the ICM-20602, a high-performance integrated motion sensor, equipped with a 3-axis gyroscope, and a 3-axis accelerometer.
Do you want to subscribe in order to receive notifications regarding "6DOF IMU 4 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "6DOF IMU 4 click" changes.
Do you want to report abuse regarding "6DOF IMU 4 click".
Library Description
The library performs a gyroscope, accelerometer and temperature measurements and control of the 6DOF IMU 4 Click board. User also can select a desired full scale range, offset and threshold for the desired measurement. The control of the 6DOF IMU 4 Click board can be performed by using I2C or SPI interface. For more details check documentation.
Key functions:
T_C6DOFIMU4_RETVAL c6dofimu4_writeByte( uint8_t regAddr, uint8_t dataIn )
- Function writes one byte data to the desired register.T_C6DOFIMU4_RETVAL c6dofimu4_readBytes( uint8_t startAddr, uint8_t *dataOut, uint8_t nBytes )
- Function performs a sequential data reading starting from the desired address.void c6dofimu4_getData( T_c6dofimu4_axis *accelOut, T_c6dofimu4_axis *gyroOut, int8_t *tempOut )
- Function performs a data reading and all necessary calculations to get accelerometer, gyroscope and temperature data.T_C6DOFIMU4_RETVAL c6dofimu4_setFSR( uint8_t gyro_resol, uint8_t accel_resol )
- Function selects a measurement full scale range.Examples description
The application is composed of the three sections :
void applicationTask()
{
dataReady = c6dofimu4_getStatus( _C6DOFIMU4_DATA_RDY_INT_MASK );
while (dataReady != _C6DOFIMU4_DATA_RDY_INT_OCCURED)
{
dataReady = c6dofimu4_getStatus( _C6DOFIMU4_DATA_RDY_INT_MASK );
}
c6dofimu4_getData( &accel_data, &gyro_data, &temperature );
mikrobus_logWrite( "** Accelerometer values :", _LOG_LINE );
logAxis( &accel_data, &accelUnit[0] );
mikrobus_logWrite( "", _LOG_LINE );
mikrobus_logWrite( "** Gyroscope values :", _LOG_LINE );
logAxis( &gyro_data, &gyroUnit[0] );
mikrobus_logWrite( "", _LOG_LINE );
mikrobus_logWrite( "** Temperature value : ", _LOG_TEXT );
ShortToStr( temperature, text );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( tempUnit, _LOG_LINE );
mikrobus_logWrite( "-------------------------------------------------", _LOG_LINE );
mikrobus_logWrite( "", _LOG_LINE );
Delay_ms( 500 );
}
Additional Functions :
Other mikroE Libraries used in the example:
I2C
SPI
UART
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.