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.
Fork of g3_waterplay by
Diff: TemperatureSensor.h
- Revision:
- 0:ad9362f18797
- Child:
- 1:f448c12d2c5b
diff -r 000000000000 -r ad9362f18797 TemperatureSensor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TemperatureSensor.h Thu Jun 02 17:53:02 2016 +0000 @@ -0,0 +1,39 @@ +/* +* G3: WATERPLAY +*/ + +#ifndef TEMPERATURE_SENSOR_H +#define TEMPERATURE_SENSOR_H + +#include "mbed.h" + +class TemperatureSensor +{ +public: + TemperatureSensor( + PinName pin, + double const_voltage, + double const_converter, + double variance, + double vin, + double resistance + ); + double read(); + double getVoltage(); + double getTemperature(); + +private: + AnalogIn _analog_in; + double _const_voltage; + double _const_converter; + double _variance; + double _vin; + double _resistance; + double _voltage; + double _k0; + double _k1; + double _k2; + double _kelvin_to_celcius; +}; + +#endif \ No newline at end of file