TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136803 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55951 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41892 times)
  6. FT800 Library (41188 times)
  7. GSM click (28990 times)
  8. PID Library (26420 times)
  9. mikroSDK (26375 times)
  10. microSD click (25382 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Gyro 5 click

Rating:

5

Author: MIKROE

Last Updated: 2019-07-11

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Motion

Downloaded: 2555 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Gyro 5 click

Gyro 5 click

Native view of the Gyro 5 click board.

View full image
Gyro 5 click

Gyro 5 click

Front and back view of the Gyro 5 click board.

View full image

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 :

  • System Initialization - Initializes GPIO pins, I2C and LOG modules.
  • Application Initialization - Initializes I2C driver and the device.
  • Application Task - Checks data ready INT, gets temperature and axes data and LOGs those values.
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 :

  • gyro5_floatCut() - Rounds float number converted to string to 2 decimals.

Other mikroE Libraries used in the example:

  • SPI
  • I2C
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

Color 16 click

0

Color 16 Click is a compact add-on board providing an accurate color-sensing solution. This board features ams AG’s AS7343, a 14-channel multi-purpose spectral sensor offering spectral response through a compatible I2C interface. It has a built-in aperture that controls the light entering the sensor array to increase accuracy, alongside precise optical filters integrated into standard CMOS silicon via deposited interference filter technology. The spectral response is defined by individual channels covering approximately 380nm to 1000nm with 11 channels centered in the visible spectrum, one near-infrared, and a clear channel.

[Learn More]

Charger 25 click

0

Charger 25 Click is a compact add-on board that contains a battery charger. This board features the BQ25792, a buck-boost battery charger with a dual-input selector, and a USB PD3.0 OTG output from Texas Instruments. It is fully integrated for 1-4 cell Li-Ion and Li-Polymer batteries. Designed specifically for USB applications, it also includes a Narrow voltage DC (NVDC) power path management in which the system is regulated at a voltage slightly higher than the battery voltage without being allowed to drop below the minimum system voltage.

[Learn More]

Shake2Wake click

0

Shake2Wake click carries an ADXL362 ultralow power, 3-axis MEMS accelerometer and ADP195 load switch. The distinguishing feature of this IC is that it incorporates several activity detection modes.

[Learn More]