altitude2
2.0.0.0
|
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. Besides that, the device also includes features such as the ultra-low noise delta-sigma 24bit ADC, low power consumption, fast conversion times, pre-programmed unique compensation values, and more.
We provide a library for the Altitude2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Altitude2 Click driver.
void altitude2_cfg_setup ( altitude2_cfg_t *cfg );
ALTITUDE2_RETVAL altitude2_init ( altitude2_t *ctx, altitude2_cfg_t *cfg );
void altitude2_default_cfg ( altitude2_t *ctx );
uint8_t altitude2_read_prom ( altitude2_t *ctx, uint8_t select_data, uint32_t *data_out );
uint8_t altitude2_set_ratio( altitude2_t *ctx, uint8_t temp_ratio, uint8_t press_ratio );
This example demonstrates the use of Altitude 2 Click to measure temperature, altitude and pressure.
The demo application is composed of two sections :
Initializes I2C 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
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 USBUART and repeats operation every 300 ms.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
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.