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 (136886 times)
  2. FAT32 Library (70017 times)
  3. Network Ethernet Library (56001 times)
  4. USB Device Library (46305 times)
  5. Network WiFi Library (41933 times)
  6. FT800 Library (41208 times)
  7. GSM click (29017 times)
  8. PID Library (26427 times)
  9. mikroSDK (26398 times)
  10. microSD click (25386 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: 3207 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

Temp-Hum 5 click

5

Temp-Hum 5 click is a temperature and humidity sensing click board, packed with features that allow simple integration into any design. It can measure a wide range of temperature and relative humidity values with high accuracy.

[Learn More]

Flash 4 click

5

Flash 4 click is a perfect solution for the mass storage option in various embedded applications. With fast performance being one of its key features, Flash 4 click can also be used for the code shadowing, execution-in-place (XIP), and data storage.

[Learn More]

nRF C click - Example

0

This is a sample program which demonstrates the use of nRF C click. Programmer uses RF module for communication between two development systems. Each module can be used as transmitter and receiver.

[Learn More]