zinnet yazıcı
/
BMA220
j
Diff: thermistor/thermistor.h
- Revision:
- 1:dc9389ccc09d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermistor/thermistor.h Wed Sep 11 12:15:15 2019 +0000 @@ -0,0 +1,28 @@ +#define BALANCE_RES_S 1500.0 +#define SAMPLE_COUNT 100 + + /* Depends on the thermistor and the circuit + * + * [V(in)] + * | + * 4.7 K(ohm) | 1.5 K(ohm) + * [+5V]-----------+-----/\/\/\/\/\-----+---/\/\/\/\/\-----------[0V] + * | | + * +-----{/\/\/\/\}-----+ + * THERMISTOR 4.7 K(ohm) + * + */ +#define RES_25C 2000.0 +#define RES_36C 1400.0 +#define RES_DIFF_PER_C ((RES_25C - RES_36C)/11.0) + +class Thermistor{ + public: + Thermistor(AnalogIn *aIn); + double getTemperature(); + private: + void getResistance(); + + double _resistance, _temperature; + AnalogIn *_aIn; +}; \ No newline at end of file