TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 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 (136650 times)
  2. FAT32 Library (69864 times)
  3. Network Ethernet Library (55901 times)
  4. USB Device Library (46244 times)
  5. Network WiFi Library (41871 times)
  6. FT800 Library (41107 times)
  7. GSM click (28960 times)
  8. PID Library (26403 times)
  9. mikroSDK (26325 times)
  10. microSD click (25341 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 2 click

Rating:

6

Author: MIKROE

Last Updated: 2019-01-08

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Motion

Downloaded: 3019 times

Not followed.

License: MIT license  

The Gyro 2 click is a three-axis digital angular rate sensor which can sense the angular movement and velocity in three perpendicular axes. The Click board is equipped with the FXAS21002C, a three-axis integrated angular rate gyroscope.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Gyro 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Gyro 2 click" changes.

Do you want to report abuse regarding "Gyro 2 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 2 click

Gyro 2 click

Native view of the Gyro 2 click board.

View full image
Gyro 2 click

Gyro 2 click

Front and back view of the Gyro 2 click board.

View full image

Library Description

The library provides generic functions for working with the click board.

Key functions:

  • uint8_t gyro2_getId() - Function for reading the ID register of the click board.
  • void gyro2_getAxisraw(int16_t *axisData) - Function for reading the raw axis data from the click board.
  • void gyro2_calcAxis(int16_t *axisData) - Function for calculating the axis data.

Examples description

The application is composed of the three sections :

  • System Initialization - Initialize the GPIO and communication structures.
  • Application Initialization - Initialize the communication interface and configure the click board.
  • Application Task - Read the x,y,z and temperature data from the click board and display the resoults on the serial port.
void applicationTask()
{
    char text[10];
    int16_t axisData[3];
    char state;
    char temperature;

    gyro2_getAxisraw(&axisData[0]);
    gyro2_calcAxis(&axisData[0]);

    IntToStr(axisData[0],&text[0]);
    Ltrim(&text[0]);
    mikrobus_logWrite("x: ",_LOG_TEXT);
    mikrobus_logWrite(&text[0],_LOG_LINE);
    IntToStr(axisData[1],&text[0]);
    Ltrim(&text[0]);
    mikrobus_logWrite("y: ",_LOG_TEXT);
    mikrobus_logWrite(&text[0],_LOG_LINE);
    IntToStr(axisData[2],&text[0]);
    Ltrim(&text[0]);
    mikrobus_logWrite("z: ",_LOG_TEXT);
    mikrobus_logWrite(&text[0],_LOG_LINE);
    temperature=gyro2_readTemperature();
    ByteToStr(temperature,&text[0]);
    Ltrim(&text[0]);
    mikrobus_logWrite("Temperature: ",_LOG_TEXT);
    mikrobus_logWrite(&text[0],_LOG_TEXT);
    mikrobus_logWrite(" °C",_LOG_LINE);
    mikrobus_logWrite("++",_LOG_LINE);
    Delay_ms(200);

}

Other mikroE Libraries used in the example:

  • Conversions Library
  • C_String Library
  • UART Library
  • I2C Library
  • SPI Library

 

Additional notes and information

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

LED Driver 17 click

0

LED Driver 17 Click is a compact add-on board that offers a simple solution for controlling multiple LEDs, making it an ideal choice for various applications. This board features the LTR3755, a highly efficient DC/DC controller from Analog Devices that operates as a constant-current source. It can easily drive high current LEDs and features onboard low-side external N-channel power MOSFETs driven from an internal regulated supply. The LED Driver 17 Click is capable of stable operation over a wide supply range and offers several LED protection features, including overvoltage and overcurrent protection. Additionally, the frequency adjust pin allows users to program the switching frequency from 100kHz to 1MHz, optimizing efficiency and performance.

[Learn More]

Thumbstick click

5

The joystick unit receives directional input in the x and y axes by way of two potentiometers connected to a stick. The mechanical pushbutton sends an interrupt signal to the microcontroller. TFT shows values.

[Learn More]

Single Cell click

5

The Single Cell click is a Click board which features MCP16251 synchronous boost regulator with true load disconnect and MCP1811A low-dropout (LDO) linear regulator that provide an ultra low quiescent current during device operation of about 250nA and can be shut down for 5nA (typical) supply current draw.

[Learn More]