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]
Rating:
Author: MIKROE
Last Updated: 2018-05-23
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Pressure
Downloaded: 5116 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.
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".
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:
Examples Description
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:
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.