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 (42079 times)
  6. FT800 Library (41389 times)
  7. GSM click (29116 times)
  8. mikroSDK (26562 times)
  9. PID Library (26503 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: 3268 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

Power Monitor click

0

Power Monitor Click is a compact add-on board that represents an ultra-precise power monitoring solution. This board features the INA228, a digital power monitor with a 20-bit delta-sigma ADC specifically designed for current-sensing applications from Texas Instruments. The INA228 reports current, bus voltage, temperature, power, energy, and charge accumulation while employing a precision ±0.5 % integrated oscillator, all while performing the needed calculations in the background. It can measure a full-scale differential input of ±163.84mV or ±40.96mV across a resistive shunt sense element, with common-mode voltage support up to +85V. This Click board™ is suitable for current-sensing applications in DC-DC converters, power inverters, telecom equipment, industrial measurements, and many more.

[Learn More]

Ammeter click

0

Ammeter click is a mikroBUS add-on board with circuitry for measuring electric current (both AC and DC).

[Learn More]

BATT-MAN 2 click

0

BATT-MAN 2 Click is a compact add-on board representing an advanced battery and power management solution. This board features the MAX77654, a single inductor, multiple-output (SIMO) power management IC (PMIC) from Maxim Integrated, now part of Analog Devices. This I2C programmable board features a buck-boost regulator that provides three independently programmable power rails from a single inductor. Also, it has one 100mA LDO output with ripple rejection for audio and other noise-sensitive applications and a highly-configurable linear charger that supports a wide range of Li+ battery capacities featuring battery temperature monitoring for additional safety (JEITA).

[Learn More]