This library is designed to work with devices like the LM335 temperature sensor. There are only two requirements for compatibility: 1) The device must be a sensor device that has an analog voltage output. 2) The physical quantity measured must vary linearly with the analog voltage. The LM335 creates an analog voltage proportional to temperature. It can work very well with this library using the nominal multiplier of 0.0050354 and offset of -273.15 or by providing two user defined calibration points to the constructor. It uses a median filter to remove unwanted noise from ADC readings.
Fork of LinearAnalogSensors by
Revision 4:a0ac12c46095, committed 2016-08-11
- Comitter:
- wang1tao
- Date:
- Thu Aug 11 11:09:32 2016 +0000
- Parent:
- 3:6a28ca406c91
- Commit message:
- First version of PH sensor Hub
Changed in this revision
AnalogPHSensor.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 6a28ca406c91 -r a0ac12c46095 AnalogPHSensor.cpp --- a/AnalogPHSensor.cpp Thu Aug 11 10:57:30 2016 +0000 +++ b/AnalogPHSensor.cpp Thu Aug 11 11:09:32 2016 +0000 @@ -20,11 +20,11 @@ #include "AnalogPHSensor.h" #include "mbed.h" +#include "mDot.h" // initialize AnalogPHSensor::AnalogPHSensor(PinName pin):_pin(pin) { - _ph = 0.0; // Zero the ph - _phArr[] = {0,0,0,0,0,0,0,0,0,0}; + _ph = 0.0; // Zero the _ph } // Populates an array with PH readings, sorts, and returns average value