TOP Contributors

  1. MIKROE (2660 codes)
  2. Alcides Ramos (356 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 (137013 times)
  2. FAT32 Library (70139 times)
  3. Network Ethernet Library (56028 times)
  4. USB Device Library (46353 times)
  5. Network WiFi Library (41968 times)
  6. FT800 Library (41295 times)
  7. GSM click (29058 times)
  8. mikroSDK (26495 times)
  9. PID Library (26452 times)
  10. microSD click (25415 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 3 click

Rating:

20

Author: MIKROE

Last Updated: 2019-04-10

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Motion

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

No Abuse Reported

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

  • 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 3 click

Gyro 3 click

Native view of the Gyro 3 click board.

View full image
Gyro 3 click

Gyro 3 click

Front and back view of the Gyro 3 click board.

View full image

Library Description

Library contains:

  • functions for getting INT and AN pin states.
  • function for setting CS pin states.
  • functions for getting and setting register values.
  • function for getting temperature register value.
  • function for getting XYZ-Axes values.
  • function for setting basic device parameters.
  • function for getting status register value.
  • function for getting FIFO data level.
  • function for interrupt threshold values and interrupt wait time.

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 :

  • System Initialization - systemInit() - Initializes I2C interface, LOG interface and GPIO pins.
  • Application Initialization - applicationInit() - Initializes I2C driver and basic device configuratoin.
  • Application Task - applicationTask() - Checks if new data is available on all three axes, If yes then reads and logs their values.
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 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

Thermo 28 click

0

Thermo 28 Click is a compact add-on board that accurately measures temperature. This board features the ams AG’s AS6221, a high-accuracy digital temperature sensor. The AS6221 consists of a Si bandgap temperature factory-calibrated sensor, 16-bit ADC, and a digital signal processor, offering a high accuracy of ±0.9°C. It provides temperature data to the host controller through a compatible I2C interface, reliability, user-selectable I2C addresses, and alert functionality, which triggers an interrupt to protect the device from excessive temperatures.

[Learn More]

RS485 4 click

0

RS485 4 Click offers an UART to RS485 signal conversion, featuring the ADM2795E specialized IC with the complete galvanic isolation.

[Learn More]

RGB Driver click demo example

0

This example is made to demonstrate the operation of the RGB Driver click.

[Learn More]