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-05-24
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Pressure
Downloaded: 3772 times
Not followed.
License: MIT license
Pressure 12 click is a barometric gauge pressure measuring Click board, equipped with the Amplified Basic Pressure sensor series (ABP), which features a ratiometric analog output, which is proportional to the applied pressure.
Do you want to subscribe in order to receive notifications regarding "Pressure 12 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Pressure 12 click" changes.
Do you want to report abuse regarding "Pressure 12 click".
Library Description
The library contains all the necessary functions for converting ADC values to real voltages and pressure values.
Key functions:
float pressure12_getPressure(uint16_t adcValue)
- Convert ADC value to Pressure data in mBar.float pressure12_getVoltage(uint16_t adcValue)
- Convert ADC value to Voltage in mV.void pressure12_setMaxVoltage(float volt)
- Sets max output voltage on the AN pin.Examples description
The application is composed of three sections :
void applicationTask()
{
uint16_t ADC_value;
float Voltage;
float Pressure;
char demoText[ 50 ];
ADC_value = pressure12_adcRead();
Voltage = pressure12_getVoltage(ADC_Value);
Pressure = pressure12_getPressure(ADC_Value);
WordToStr(ADC_value, demoText);
mikrobus_logWrite(" ADC value: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
FloatToStr(Voltage, demoText);
mikrobus_logWrite(" Voltage: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_TEXT );
mikrobus_logWrite(" mV", _LOG_LINE );
FloatToStr(Pressure, demoText);
mikrobus_logWrite(" Pressure: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" mBar", _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.
Library Description
The library contains all the necessary functions for converting ADC values to real voltages and pressure values.
Key functions:
float pressure12_getPressure(uint16_t adcValue)
- Convert ADC value to Pressure data in mBar.float pressure12_getVoltage(uint16_t adcValue)
- Convert ADC value to Voltage in mV.void pressure12_setMaxVoltage(float volt)
- Sets max output voltage on the AN pin.Examples description
The application is composed of three sections :
void applicationTask()
{
uint16_t ADC_value;
float Voltage;
float Pressure;
char demoText[ 50 ];
ADC_value = pressure12_adcRead();
Voltage = pressure12_getVoltage(ADC_Value);
Pressure = pressure12_getPressure(ADC_Value);
WordToStr(ADC_value, demoText);
mikrobus_logWrite(" ADC value: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
FloatToStr(Voltage, demoText);
mikrobus_logWrite(" Voltage: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_TEXT );
mikrobus_logWrite(" mV", _LOG_LINE );
FloatToStr(Pressure, demoText);
mikrobus_logWrite(" Pressure: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" mBar", _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.