TOP Contributors

  1. MIKROE (2658 codes)
  2. Alcides Ramos (355 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 (136930 times)
  2. FAT32 Library (70051 times)
  3. Network Ethernet Library (56012 times)
  4. USB Device Library (46313 times)
  5. Network WiFi Library (41935 times)
  6. FT800 Library (41244 times)
  7. GSM click (29036 times)
  8. PID Library (26435 times)
  9. mikroSDK (26430 times)
  10. microSD click (25391 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: 3344 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

EnOcean 3 click

0

EnOcean 3 Click carries an ultra-low power TCM515 transceiver gateway module which operates at 868MHz radio band, perfectly suited for the realization of transceiver gateways, actuators and controllers for systems communicating based on the EnOcean radio standard.

[Learn More]

Hall Current 15 click

0

Hall Current 15 Click is a compact add-on board that provides precise AC or DC current-sensing solution. This board features the TMCS1101-Q1, a galvanically isolated Hall-effect current sensor capable of DC or AC current measurement with high accuracy, excellent linearity, and temperature stability from Texas Instruments. A low-drift, temperature-compensated signal chain provides <1.5% full-scale error across a broad operating temperature range. It also provides a reliable 600V lifetime working voltage and 3kVRMS isolation between the current path and circuitry with uni/bidirectional current sensing. Besides, the user is allowed to process the output signal in analog or digital form.

[Learn More]

GSR click

0

GSR click can be used to measure the electrodermal activity (EDA) of the human body, also known as the galvanic skin response (GSR).

[Learn More]