BoldizarF / ariot19

Other
0 stars 0 forks source link

Attach and implement temperature-sensor to handheld #24

Open BoldizarF opened 5 years ago

Blondiejohan commented 5 years ago

include

int sensorPin = A5; // select the input pin for the potentiometer

double Thermistor(int RawADC) { double Temp; Temp = log(10000.0((1024.0/RawADC-1))); Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 Temp Temp )) Temp ); Temp = Temp - 273.15; // Convert Kelvin to Celcius //Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit return Temp; }

void setup() { Serial.begin(9600); }

void loop() { int readVal=analogRead(sensorPin); double temp = Thermistor(readVal);

Serial.println(temp); // display tempature //Serial.println(readVal); // display tempature

delay(500); }

platisd commented 5 years ago

Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 Temp Temp ))* Temp );

Jesus Christ! 😱

Blondiejohan commented 5 years ago

Very advanced, worked like a charm except card is mislabeled with + and -