update with altimeter, swimfile.txt endleg.txt, etc see changes_13sep.txt also reset_PI()
Dependencies: mbed MODSERIAL FATFileSystem
Diff: Sensors/Sensors.cpp
- Revision:
- 99:9d0849f5fcd7
- Parent:
- 74:d281aaef9766
--- a/Sensors/Sensors.cpp Mon May 20 18:57:23 2019 +0000 +++ b/Sensors/Sensors.cpp Fri Jun 28 13:59:11 2019 +0000 @@ -19,7 +19,21 @@ return ( adc().readCh7() / 4095.0 * _reference_voltage ); } -//currently using BCE CS line for this data + float Sensors::getAltimeterChannelReadings() { return adc().readCh2(); //channel 2 (third channel) from the schematic +} + +float Sensors::getAltimeterReading_m() { // edit by CAM + return _altimeter_slope * adc().readCh2() + _altimeter_intercept; +} + +void Sensors::setAltimeterSlope(float S){ + _altimeter_slope = S; + return; +} + +void Sensors::setAltimeterIntercept(float I){ + _altimeter_intercept = I; + return; } \ No newline at end of file