Yihui Xiong
/
Arch_Analog_Thermistor_Blinker
Temperature Sensing
Fork of Arch_Analog_Thermistor_Blinker by
Diff: main.cpp
- Revision:
- 7:5c2ade6745ae
- Parent:
- 6:914bd412ceda
diff -r 914bd412ceda -r 5c2ade6745ae main.cpp --- a/main.cpp Tue Oct 08 08:53:33 2013 +0000 +++ b/main.cpp Wed Aug 20 07:17:31 2014 +0000 @@ -1,6 +1,6 @@ #include "mbed.h" -AnalogIn thermistor(P0_11); /* Thermistor output connected to P0_11 */ +AnalogIn thermistor(A1); /* Temperature sensor connected to Analog Grove connector */ DigitalOut tensplaceLED(LED4); /* This led blinks as per tens place of temperature value(in deg C) */ DigitalOut unitsplaceLED(LED1); /* This led blinks as per units place of temperature value(in deg C) */ @@ -17,7 +17,7 @@ resistance= (float) 10000.0 * ((65536.0 / a) - 1.0); /* Convert the resistance to temperature using Steinhart's Hart equation */ - temperature=(1/((log(resistance/5000.0)/beta) + (1.0/298.15)))-273.15; + temperature=(1/((log(resistance/10000.0)/beta) + (1.0/298.15)))-273.15; units = (int) temperature % 10; tens = (int) temperature / 10;