TOP Contributors

  1. MIKROE (2665 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 (137159 times)
  2. FAT32 Library (70288 times)
  3. Network Ethernet Library (56159 times)
  4. USB Device Library (46482 times)
  5. Network WiFi Library (42150 times)
  6. FT800 Library (41450 times)
  7. GSM click (29146 times)
  8. mikroSDK (26595 times)
  9. PID Library (26519 times)
  10. microSD click (25529 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: 3448 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

Analog To PWM click

5

AN to PWM Click is a device that converts the value of the input analog signal with virtually any wave shape to a fixed frequency PWM voltage output, with a duty cycle proportional to the input voltage

[Learn More]

Temp-Log 7 click

0

Temp-Log 7 Click is a compact add-on board used to measure and record the temperature of an environment over time. This board features the TMP1826, a high-accuracy, 1-Wire® compatible digital output temperature sensor from Texas Instruments with integrated 2-kbit EEPROM. It supports a wide operating temperature range from –20°C to +85°C with its high accuracy of ±0.1°C (typical)/±0.3°C (maximum) and comes with a factory-programmed 64-bit unique identification number for addressing and NIST traceability. Besides a programmable alarm function that outputs an interrupt signal to the MCU when a specific temperature event occurs, it also has three digital I/O pins configurable for general purposes or to identify the device's position on a shared bus.

[Learn More]

Relay 6 click

0

Relay 6 Click is a compact add-on board for precise load control and monitoring applications. This board features four 9913-05-20TRs, a reed relay from Coto Technology, well-known for its ultra-miniature SMD design, which offers the smallest footprint in the market. These four relays each have four load connection terminals and blue LED indicators that signal the operational status, ensuring clear and immediate feedback.

[Learn More]