Yihui Xiong
/
Arch_Analog_Thermistor_Blinker
Temperature Sensing
Fork of Arch_Analog_Thermistor_Blinker by
Revision 7:5c2ade6745ae, committed 2014-08-20
- Comitter:
- yihui
- Date:
- Wed Aug 20 07:17:31 2014 +0000
- Parent:
- 6:914bd412ceda
- Commit message:
- fix the equation and change the analog pin
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
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;
diff -r 914bd412ceda -r 5c2ade6745ae mbed.bld --- a/mbed.bld Tue Oct 08 08:53:33 2013 +0000 +++ b/mbed.bld Wed Aug 20 07:17:31 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/9c8f0e3462fb \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file