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 (136819 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55955 times)
  4. USB Device Library (46277 times)
  5. Network WiFi Library (41893 times)
  6. FT800 Library (41203 times)
  7. GSM click (28993 times)
  8. PID Library (26420 times)
  9. mikroSDK (26377 times)
  10. microSD click (25383 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

Altitude 3 click

Rating:

5

Author: MIKROE

Last Updated: 2019-02-01

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Pressure

Downloaded: 3326 times

Not followed.

License: MIT license  

Altitude 3 click allows high-resolution barometric pressure measurement, by utilizing the ICP-10100, an integrated barometric pressure and temperature sensor.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Altitude 3 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Altitude 3 click" changes.

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

Altitude 3 click

Altitude 3 click

Native view of the Altitude 3 click board.

View full image
Altitude 3 click

Altitude 3 click

Front and back view of the Altitude 3 click board.

View full image

Library Description

The library performs a control of the Altitude 3 Click board. This library can read a calibration data from OTP sensor, also a temperature and pressure results of AD conversion. The all converted results can be calculated to standard units, and depending on the temperature and pressure data the library can calculate altitude. For more details check documentation.

Key functions:

  • T_ALTITUDE3_RETVAL altitude3_measurementMode( uint16_t modeCmd ) - Function sends a command which selects a measurement mode and data reading order.
  • void altitude3_init( T_altitude3_param *s ) - Function sends a command to read calibration data from OTP sensor and other initialization data, which is necessary for calculations.
  • T_ALTITUDE3_RETVAL altitude3_getData( uint8_t read_order, int8_t *temperature, uint16_t *pressure, int16_t *altitude ) - Function performs a calibration data reading, only once, and then reads a temperature and pressure data and calculates these values to standard units. Also calculates the altitude depending on the temperature and pressure data.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes I2C interface and performs a SW Reset of the device.
  • Application Task - (code snippet) - Selects the desired measurement mode and data reading order, and after that calculates the temperature, pressure and altitude data to standard units and shows results to uart terminal.
void applicationTask()
{
    response = altitude3_measurementMode( _ALTITUDE3_NORMAL_T_FIRST );

    response = altitude3_getData( response, &_temperature, &_pressure, &_altitude );
    
    if (response == _ALTITUDE3_OK)
    {
        ShortToStr( _temperature, text );
        mikrobus_logWrite( "Temperature is : ", _LOG_TEXT );
        mikrobus_logWrite( text, _LOG_TEXT );
        logUnit();

        WordToStr( _pressure, text );
        mikrobus_logWrite( "Pressure is : ", _LOG_TEXT );
        mikrobus_logWrite( text, _LOG_TEXT );
        mikrobus_logWrite( " mbar[hPa]", _LOG_LINE );
    
        IntToStr( _altitude, text );
        mikrobus_logWrite( "Altitude is : ", _LOG_TEXT );
        mikrobus_logWrite( text, _LOG_TEXT );
        mikrobus_logWrite( " m", _LOG_LINE );
        mikrobus_logWrite( "", _LOG_LINE );

        Delay_ms( 400 );
    }
}

Additional Functions :

  • logUnit - Shows Celsius degrees symbol to uart terminal.

Other mikroE Libraries used in the example:

  • Conversions
  • I2C
  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB UART 2 clickor 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

VREG 2 click

5

VREG 2 click is a voltage regulator click, with outstanding performances. It has a steady output voltage with the ripple lower than 5mV, short circuit protection with the LED indicator, and high efficiency with minimal power dissipation.

[Learn More]

Tamper click

5

Tamper click is equipped with SDS001, a low profile side-actuated detect switch, made by C&K company. The click is additionally equipped with the RC filter that minimizes the bouncing effect, making this click a reliable solution for any contact detection application.

[Learn More]

Stepper 8 click

5

Stepper 8 Click is Click board based on TC78H670FT from Toshiba, a clock-in and serial controlled Bipolar Stepping Motor Driver which can drive a 128 micro-stepping motor with a power supply ranging from 2.5V to 16V for wide range of applications includes USB-powered, battery-powered, and standard 9-12V system devices.

[Learn More]