Mario Simaremare
/
g3_waterplay
Salinity and temperature sensors are implemented in classes.
TemperatureSensor.h
- Committer:
- mariosimaremare
- Date:
- 2016-06-07
- Revision:
- 1:f448c12d2c5b
- Parent:
- 0:ad9362f18797
- Child:
- 2:ed17e258da0d
File content as of revision 1:f448c12d2c5b:
/* * G3: WATERPLAY */ #ifndef TEMPERATURE_SENSOR_H #define TEMPERATURE_SENSOR_H #include "mbed.h" class TemperatureSensor { public: TemperatureSensor( mbed::Serial &serial, PinName pin, double const_voltage, double const_converter, double variance, double vin, double resistance ); double read(); double getVoltage(); double getTemperature(); private: Serial &_serial; AnalogIn _analog_in; double _const_voltage; double _const_converter; double _variance; double _vin; double _resistance; double _reading; double _voltage; double _temperature; double _k0; double _k1; double _k2; double _kelvin_to_celcius; }; #endif