Skip to content
Snippets Groups Projects
Commit e4a50685 authored by Alberto Nidasio's avatar Alberto Nidasio
Browse files

[Sensors] Fixed analog pressures sensors transfer function

parent af69f1d4
No related branches found
No related tags found
No related merge requests found
...@@ -495,8 +495,15 @@ void Sensors::ads131m04Init() ...@@ -495,8 +495,15 @@ void Sensors::ads131m04Init()
void Sensors::staticPressureInit() void Sensors::staticPressureInit()
{ {
function<ADCData()> getVoltage( function<ADCData()> getVoltage = [&]()
bind(&ADS131M04::getVoltage, ads131m04, ADC_CH_STATIC_PORT)); {
auto data = ads131m04->getVoltage(ADC_CH_STATIC_PORT);
// Account for the voltage divider with 10K and 2.31K
data.voltage = data.voltage * (10 + 2.31) / 2.31;
return data;
};
staticPressure = new MPXH6115A(getVoltage, REFERENCE_VOLTAGE); staticPressure = new MPXH6115A(getVoltage, REFERENCE_VOLTAGE);
...@@ -518,8 +525,15 @@ void Sensors::staticPressureInit() ...@@ -518,8 +525,15 @@ void Sensors::staticPressureInit()
void Sensors::dplPressureInit() void Sensors::dplPressureInit()
{ {
function<ADCData()> getVoltage( function<ADCData()> getVoltage = [&]()
bind(&ADS131M04::getVoltage, ads131m04, ADC_CH_DPL_PORT)); {
auto data = ads131m04->getVoltage(ADC_CH_DPL_PORT);
// Account for the voltage divider with 10K and 2.31K
data.voltage = data.voltage * (10 + 2.31) / 2.31;
return data;
};
dplPressure = new MPXH6400A(getVoltage, REFERENCE_VOLTAGE); dplPressure = new MPXH6400A(getVoltage, REFERENCE_VOLTAGE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment