6DOF IMU 4 Click Board
6DOF IMU 4 Click Board
The 6DOF IMU 4 Click Board™ is an advanced 6-axis motion tracking Click Board™, which utilises the ICM-20602, a high-performance integrated motion sensor equipped with a 3-axis gyroscope and a 3-axis accelerometer. There is a MEMS on each axis, sampled by a 16-bit A/D converter (ADC). Data streams from each axis are fed to a signal processing engine, offering calibrated readings of each axis over the I2C or SPI interface. A FIFO buffer with 1kb of memory allows MCU firmware optimisation.
Packed with a set of powerful options, the 6DOF IMU 4 Click Board™ represents an ideal solution for developing Motion Tracking applications.
Software Support
We provide a library for the 6DOF IMU 4 Click Board™ on our LibStock page and a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library performs a gyroscope, accelerometer and temperature measurements and controls the 6DOF IMU 4 Click board. Users 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 the 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.
Example Description
The application is composed of three sections :
- System Initialization - Initializes peripherals and pins.
- Application Initialization - Initializes I2C or SPI interface and performs a device reset and configurations.
- Application Task - (code snippet) - Waits until data is ready, reads all data registers, accelerometer, gyroscope and temperature data, and shows results to the UART terminal every 500ms.
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 :
- floatCut - Makes to float values be rounded on two decimal places.
- logAxis - Logs axis values for the desired measured data on the UART terminal.
The complete application code and ready-to-use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
I2C
SPI
UART
Additional Notes and Information
Depending on the development board you are using, you may need USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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.
MIKROSDK
The 6DOF IMU 4 Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click Board™ board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
6DOF IMU 4 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.