Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MODSERIAL FATFileSystem
Diff: omegaPX209/omegaPX209.cpp
- Revision:
- 56:48a8a5a65b82
- Parent:
- 55:f4ec445c42fe
- Child:
- 67:c86a4b464682
--- a/omegaPX209/omegaPX209.cpp Tue Jun 12 15:41:51 2018 +0000
+++ b/omegaPX209/omegaPX209.cpp Tue Jun 12 16:20:03 2018 +0000
@@ -42,7 +42,8 @@
// filter by over-sampling
float add = 0;
float adc_reading = 0;
- float PSI_reading = 0;
+
+ _PSI_reading = 0; //reset each time
for (int i = 0; i < OVERSAMPLE; i++) {
// analog input _adc is float 0.0 to 1.0
@@ -52,7 +53,7 @@
_PSI_reading = adc_reading * _adcVoltage * _psi_per_volt_cal; //Note: real_voltage_reading = adc_reading * _adcVoltage
- add += PSI_reading; //replaced _adc.read()
+ add += _PSI_reading; //replaced _adc.read()
}
// use over-sampled
@@ -89,6 +90,7 @@
}
float omegaPX209::getRawPSI() {
- float pressure_raw = adc().readCh4()/4095.0 * _adcVoltage * _psi_per_volt_cal;
- return pressure_raw;
+// float pressure_raw = adc().readCh4()/4095.0 * _adcVoltage * _psi_per_volt_cal;
+// return pressure_raw;
+ return _PSI_reading;
}
\ No newline at end of file