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-07-11
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 3015 times
Not followed.
License: MIT license
Gyro 5 Click is a three-axis gyroscope Click board that can sense motion over three perpendicular axes. It is equipped with the ITG-3701, a three-axis digital gyroscope.
Do you want to subscribe in order to receive notifications regarding "Gyro 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Gyro 5 click" changes.
Do you want to report abuse regarding "Gyro 5 click".
Library Description
Library contains function for getting INT pin state Library contains function for setting CS pin state Library contains function for getting register values Library contains function for setting register values Library contains function for device initialization Library contains function for getting temperature value Library contains function for getting axes values Library contains function for software reset Library contains functions for setting power mode and full scale range
Key functions:
uint8_t gyro5_initialize( void )
- initializes the device.uint8_t gyro5_get_temperature( float * temperature )
- reads temperature measurement registers and converts raw temperature data to get die temperature in [deg C].uint8_t gyro5_get_axes( float * x_axis, float * y_axis, float * z_axis )
- reads axes measurement registers and converts raw axes measurement data to get gyroscope data in [deg/s].Examples description
The application is composed of three sections :
void applicationTask( )
{
data_ready_flag = gyro5_interrupt_status( _GYRO5_INT_DATA_RDY );
if (data_ready_flag == 1)
{
gyro5_get_temperature( &temperature_value );
gyro5_get_axes( &x_axis_value, &y_axis_value, &z_axis_value );
mikrobus_logWrite( " ", _LOG_LINE );
FloatToStr( x_axis_value, text );
gyro5_floatCut( );
mikrobus_logWrite( "> X axis = ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( degrees_per_second, _LOG_LINE );
FloatToStr( y_axis_value, text );
gyro5_floatCut( );
mikrobus_logWrite( "> Y axis = ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( degrees_per_second, _LOG_LINE );
FloatToStr( z_axis_value, text );
gyro5_floatCut( );
mikrobus_logWrite( "> Z axis = ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( degrees_per_second, _LOG_LINE );
FloatToStr( temperature_value, text );
gyro5_floatCut( );
mikrobus_logWrite( "> Temperature = ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( degrees_celsius, _LOG_LINE );
}
Delay_ms(300);
}
Additional Functions :
Other mikroE Libraries used in the example:
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.