Mario Simaremare
/
g3_waterplay
Salinity and temperature sensors are implemented in classes.
TemperatureSensor.h
- Committer:
- mariosimaremare
- Date:
- 2016-06-16
- Revision:
- 3:7c648d1d8802
- Parent:
- 2:ed17e258da0d
- Child:
- 5:4cbe44452889
File content as of revision 3:7c648d1d8802:
/* * G3: WATERPLAY */ #ifndef TEMPERATURE_SENSOR_H #define TEMPERATURE_SENSOR_H #include "mbed.h" #include "Printer.h" class TemperatureSensor { public: TemperatureSensor( Printer &printer, PinName pin, double const_voltage, double const_converter, double const_lower_boundary, double const_upper_boundary, double variance, double vin, double resistance ); void reload(); double getReading(); double getVoltage(); double getTemperature(); double getStatus(); char* getStrStatus(); private: Printer &_printer; AnalogIn _analog_in; double _const_voltage; double _const_converter; double _const_lower_boundary; double _const_upper_boundary; int _const_sample_number; double _variance; double _vin; double _resistance; double _reading; double _voltage; double _temperature; double _status; char* _strStatus; double _k0; double _k1; double _k2; double _kelvin_to_celcius; }; #endif