TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (347 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 (136218 times)
  2. FAT32 Library (69480 times)
  3. Network Ethernet Library (55705 times)
  4. USB Device Library (45989 times)
  5. Network WiFi Library (41639 times)
  6. FT800 Library (40780 times)
  7. GSM click (28788 times)
  8. PID Library (26327 times)
  9. mikroSDK (26053 times)
  10. microSD click (25139 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 2 click

Rating:

5

Author: MIKROE

Last Updated: 2018-05-23

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Pressure

Downloaded: 4493 times

Not followed.

License: MIT license  

Altitude 2 click is a high-resolution barometric pressure sensor Click board. It provides very accurate measurements of temperature and atmospheric pressure, which can be used to calculate the altitude with a very high resolution of 20cm per step.

No Abuse Reported

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

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

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

Altitude 2 click

Altitude 2 click

Native view of the Altitude 2 click borad.

View full image
Altitude 2 click

Altitude 2 click

Front and back view of the Altitude 2 click board.

View full image

Library Description

The library initializes and defines I2C and SPI driver and performs the communication with device registers by both drivers. The library offers a choice to measure the temperature in Celsius units, and the pressure in mbar units. The user can determine the oversampling ratio value for both measurements independently. For more details check the documentation.


Key functions:

  • uint8_t altitude2_readPROM( uint8_t selectData, uint32_t *dataOut )- The function reads calibration data from PROM.
  • uint8_t altitude2_setRatio( uint8_t tempRatio, uint8_t pressRatio )- The function determines the oversampling ratio value for temperature and pressure measurements.
  • void altitude2_readData( float *tempData, float *pressData, float *altitudeData )- The function performs temperature and pressure measurements with desired oversampling ratio and performs the calculations that convert temperature data in Celsius value and pressure data in mbar value. Depending on the temperature and pressure calculated values, the function calculates the altitude value in meters.

Examples Description

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes I2C/SPI driver and performs the device reset, after which the calibration coefficients be read. Determines the ratio value for temperature and pressure measurements. Calibration coefficients are necessary to read after the device reset.
  • Application Task - (code snippet) - Gets temperature data in Celsius value and pressure data in mbar value. Gets the calculated altitude value in meters which depends on the temperature and pressure measurements. Logs results on USB UART and repeats operation every 300 ms.
void applicationTask()
{
 altitude2_readData( &temperature, &pressure, &altitude );

 mikrobus_logWrite( "Temperature is: ", _LOG_TEXT );
 FloatToStr( temperature, text );
 mikrobus_logWrite( text, _LOG_TEXT );
 mikrobus_logWrite( " Celsius", _LOG_LINE );

 mikrobus_logWrite( "Pressure is: ", _LOG_TEXT );
 FloatToStr( pressure, text );
 mikrobus_logWrite( text, _LOG_TEXT );
 mikrobus_logWrite( " mbar", _LOG_LINE );

 mikrobus_logWrite( "Altitude is: ", _LOG_TEXT );
 FloatToStr( altitude, text );
 mikrobus_logWrite( text, _LOG_TEXT );
 mikrobus_logWrite( " m", _LOG_LINE );
 mikrobus_logWrite( "", _LOG_LINE );

 Delay_ms( 300 );
}

mikroE Libraries used in the example:

  • Conversions
  • I2C
  • SPI
  • UART

Additional notes and information

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

EEPROM 5 click

5

EEPROM 5 Click is a compact add-on board that contains the highest-density memory solution. This board features the M95M04, the 4Mbit electrically erasable programmable memory organized as 524288 x 8 bits accessed through the SPI interface from STMicroelectronics.

[Learn More]

IR click

0

IR Click is an add-on board in mikroBUS form factor. It features TSOP38338 IR receiver module as well as QEE113 IR emitting diode. IR Clickâ„¢ communicates with the target microcontroller via mikroBUSâ„¢ UART (Tx and Rx) or AN and PWM lines. Jumpers J2 and J3 enable you to choose between these two ways. The board uses a 3.3V or 5V power supply.

[Learn More]

mikromedia for Stellaris - Examples

0

Set of examples for mikromedia for Stellaris® M3. Provided examples demonstrate working with mikromedia's various features and modules:

- Accelerometer
- MMC SD card
- MP3
- Serial Flash
- TFT
- Touch Panel
- USB

[Learn More]