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: 2020-05-27
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Pressure
Downloaded: 2464 times
Not followed.
License: MIT license
Altitude 4 Click introduces an absolute pressure sensor with digital output for low-cost applications labeled as NPA-201. The NovaSensor NPA-201 Digital Output Absolute Pressure Sensor provides low power consumption and compact size, making it ideal for battery-powered and mobile applications or any application where size is a constraint.
Do you want to subscribe in order to receive notifications regarding "Altitude 4 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Altitude 4 click" changes.
Do you want to report abuse regarding "Altitude 4 click".
Library Description
Library provides functions for communication with device via I2C protocol.
Key functions:
void altitude4_generic_read ( uint8_t reg_adr, uint8_t *rx_buf, uint8_t buf_len )
- Function for reading data from devicevoid altitude4_generic_write ( uint8_t reg_adr, uint8_t *tx_buf, uint8_t buf_len )
- Function for writing data to deviceuint8_t altitude4_read_sensor ( altitude4_sensor_t *sensor_data )
- Function for reading sensor dataExamples description
The application is composed of three sections :
void application_task ( )
{
altitude4_sensor_t sensor_data;
char demo_txt[ 30 ];
altitude4_read_sensor( &sensor_data );
FloatToStr( sensor_data.altitude, demo_txt );
mikrobus_logWrite( " - Altitude: ", _LOG_TEXT );
mikrobus_logWrite( demo_txt, _LOG_TEXT );
mikrobus_logWrite( " m", _LOG_LINE );
FloatToStr( sensor_data.pressure, demo_txt );
mikrobus_logWrite( " - Pressure: ", _LOG_TEXT );
mikrobus_logWrite( demo_txt, _LOG_TEXT );
mikrobus_logWrite( " mBar", _LOG_LINE );
FloatToStr( sensor_data.temperature, demo_txt );
mikrobus_logWrite( " - Temperature: ", _LOG_TEXT );
mikrobus_logWrite( demo_txt, _LOG_TEXT );
mikrobus_logWrite( log_degree, _LOG_LINE );
mikrobus_logWrite( "_________________________________________", _LOG_LINE );
Delay_ms( 1000 );
}
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.