For Hepta-Sat Lite
Diff: HeptaTemp.cpp
- Revision:
- 8:3cb7f1ea12bf
- Parent:
- 6:9a367d5cf53d
--- a/HeptaTemp.cpp Wed Aug 21 12:20:04 2019 +0000 +++ b/HeptaTemp.cpp Tue Aug 17 10:51:03 2021 +0000 @@ -8,35 +8,8 @@ void HeptaTemp::temp_sense(float* temp) { -//resistance - R1 = 2500; - R2 = 2500; - R3 = 110; - R4 = 1000; - R5 = 68000; - Pt = 100; - R_1 = 3; - R_2 = 2; - -//current - I = 0.001; - -//voltage - Vref = 2.5; - -//Gain&Offset - float gain = -R5*I/R4; - float off = Vref+I*R3; - -//temperature coefficient - ce = 0.003851; - float volt = (_pin.read())*3.3*(R_1 + R_2)/R_1; - float Rth = (volt-off)/gain+R3; - *temp = (Rth-Pt)/(ce*Pt); - -// delay some time before reading again - //wait(0.5); - + //temperature coefficient + *temp = ((_pin.read())*3.3-0.6)*100; } void HeptaTemp::temp_sense_u16(char* temp_u16) @@ -55,8 +28,5 @@ void HeptaTemp::temp_sensing_vol(float* voltage) { - R_1 = 3; - R_2 = 2; - *voltage = (_pin.read())*3.3*(R_1 + R_2)/R_1; - + *voltage = (_pin.read())*3.3; } \ No newline at end of file