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-04-10
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 3634 times
Not followed.
License: MIT license
Gyro 3 click is a three-axis gyroscope Click board that can sense motion over three perpendicular axes. It is equipped with the I3G4250, a three-axis digital gyroscope.
Do you want to subscribe in order to receive notifications regarding "Gyro 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Gyro 3 click" changes.
Do you want to report abuse regarding "Gyro 3 click".
Library Description
Library contains:
Key functions:
void gyro3_config( void )
- sets basic settings to device.void gyro3_getStatus( uint8_t * status_register )
- gets value of status register (27h).void gyro3_getAxes( float * x_axis, float * y_axis, float * z_axis, uint8_t measurement_range )
- reads values from XYZ-Axes registers and converts them to degrees per second value based on measurement range setting.Examples description
The application is composed of the three sections :
void applicationTask( )
{
gyro3_getStatus( &status_register );
if ((status_register & _GYRO3_ZYX_NEW_DATA_MASK) == _GYRO3_ZYX_NEW_DATA_MASK)
{
gyro3_getAxes( &x_axis, &y_axis, &z_axis, _GYRO3_MEAS_RANGE_2000 );
mikrobus_logWrite( "rn>>>>>>>>>>>>>>>>>>>", _LOG_LINE );
FloatToStr( x_axis, text );
mikrobus_logWrite( "x_axis : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( degrees_per_second, _LOG_LINE );
FloatToStr( y_axis, text );
mikrobus_logWrite( "y_axis : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( degrees_per_second, _LOG_LINE );
FloatToStr( z_axis, text );
mikrobus_logWrite( "z_axis : ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( degrees_per_second, _LOG_LINE );
mikrobus_logWrite( "<<<<<<<<<<<<<<<<<<<", _LOG_LINE );
}
Delay_ms(100);
}
Other mikroE Libraries used in the example:
I2C
UART
SPI
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.