TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137101 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56126 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42077 times)
  6. FT800 Library (41388 times)
  7. GSM click (29116 times)
  8. mikroSDK (26562 times)
  9. PID Library (26499 times)
  10. microSD click (25487 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: 3260 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

Ambient 18 click

0

Ambient 18 Click is a compact add-on board used to sense the amount of the present ambient light. This board features the BH1680FVC, an analog current-output ambient light sensor from Rohm Semiconductor. The BH1680FVC can detect a wide range of illuminance up to 10klx and provides excellent responsivity close to the human eyes' response. Besides, it is also characterized by low sensitivity variation across various light sources, a built-in shutdown function, and the ability to process the output signal in analog or digital form. This Click board™ is the most suitable for obtaining ambient light data for adjusting brightness in applications that require power saving and better visibility.

[Learn More]

Button G click

1

Button G click is the simplest solution for adding a single pushbutton to your design. The button itself is transparent, 6.8mm in diameter and has a green LED backlight. When pressed, it sends an interrupt signal to the target board microcontroller. The backlight LED is controlled separately through the mikroBUSâ„¢ PWM pin.

[Learn More]

3D Hall 10 click

0

3D Hall 10 Click is a compact add-on board used to detect the strength of a magnetic field in all three dimensions. This board features the TMAG5170, a high-precision linear 3D Hall effect sensor from Texas Instruments. The TMAG5170 features an SPI interface for configuration by MCU. The measurement data is provided in digital format of 12-bits corresponding to the magnetic field measured in each X, Y, and Z axes. It can achieve ultra-high precision at speeds up to 20kSPS for faster and more accurate real-time control and offers multiple diagnostics features to detect and report both system and device-level failures.

[Learn More]