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: 2019-02-01
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Pressure
Downloaded: 3830 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.
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".
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 :
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 :
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 click, USB 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.