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.
Dependencies: Data_Clock_Pair Seeed_Chainable_LED Seeed_Four_Digit_Disp Seeed_IR_Temp_Sensor Seeed_Led_Bar
Fork of Seeed_Grove_4_Digit_Display_Clock by
Diff: SeeedIRTempSensor.h
- Revision:
- 18:904d89c7811a
- Parent:
- 17:71c14845db51
- Child:
- 19:ad7bc3db9f1a
--- a/SeeedIRTempSensor.h Sun May 21 13:33:34 2017 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/* #include <cmath> */
-#include "mbed.h"
-namespace IRTempSensor{
-#define SUR_TEMP_PIN PA_3 // Analog input pin connect to temperature sensor SUR pin
-#define OBJ_TEMP_PIN PC_0 // Analog input pin connect to temperature sensor OBJ pin
-
-double measuresureTemp(PinName surPin) {
- AnalogIn surTPin(surPin);
- float volts, resistance, temperature;
- volts = 0;
- for (int i = 0; i < 100; i++) {
- volts += surTPin.read();
- wait_us(10);
- }
- volts *= 3.3/100;
- resistance = 2000000*volts/(2.5-volts);
- temperature = 1/(log(resistance/100000)/3964 +(1/298.15)) - 273.15;
- return temperature;
-}
-
-float measureObjectTemp(PinName surPin, PinName objPin) {
- AnalogIn objTPin(objPin);
- float objV = 0;
- for (int i = 0; i < 100; i++) {
- objV += objTPin.read();
- wait_us(10);
- }
- objV *= 3.3/100;
- /* float pileSignal= objV - 2.5*17.4/(17.4+64); */
- float pileSignal = objV - 0.52;
- pileSignal *= 0.01;
- float ts = measuresureTemp(surPin) + 273.15;
- /* float calib = 1+(298.15 - ts)*0.0011; */
- float calib = 1;
- float k = 3.45*pow(10,-13)*calib;
- float kRecip = 2976078405624.9985;
- float kRecipAmp = kRecip * 0.01;
- /* float objT = (pileSignal*kRecip + ts*ts*ts*ts); */
- float objT = (objV*kRecipAmp -0.51*kRecipAmp + ts*ts*ts*ts);
- return pow(objT,0.25) - 273.15;
- /* return pileSignal*1000; */
- /* return objV*100; */
-}};
