NTC temperature sensor going to A:D input. Topology is: (Vref or 3.3V) -> Series_resistor -> A:D_input -> NTC -> GND. Easy modification of NTC parameters w/o recompile of library

Dependents:   ntc_helloworld

Revision:
2:c843c06cc651
Parent:
0:c0bdc272d5da
Child:
3:1eb4f5296281
--- a/ntc.cpp	Fri Apr 07 00:39:59 2017 +0000
+++ b/ntc.cpp	Fri Apr 07 16:36:47 2017 +0000
@@ -50,7 +50,7 @@
 }
 
 float NTC::get_ntc_res_viaAD(uint16_t din) {
-    uint16_t ad = rawdata;
+    uint16_t ad = din;
     if(din == 0) {
         ad = NTC::read_ad_reg();
     }
@@ -86,3 +86,4 @@
     return (beta / (log(ntc_res / (ntc_set_data.ntc_res * exp(-beta / 298.0f)))) - 273.0f);
 }
 
+