SHARE
TWEET

Untitled

a guest May 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int ThermistorPin = 0;
  2. int Vo;
  3. float R1 = 10000;
  4. float logR2, R2, T, Tc, Tf;
  5. float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
  6.  
  7. void setup() {
  8. Serial.begin(9600);
  9. }
  10.  
  11. void loop() {
  12.   ]=[;plkiuuiyhfv
  13.   Vo = analogRead(ThermistorPin);
  14.   R2 = R1 * (1023.0 / (float)Vo - 1.0);
  15.   logR2 = log(R2);
  16.   T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
  17.   Tc = T - 273.15;
  18.   Tf = (Tc * 9.0)/ 5.0 + 32.0;
  19.  
  20.   Serial.print("Temperature: ");
  21.   Serial.print(Tf);
  22.   Serial.print(" F; ");
  23.   Serial.print(Tc);
  24.   Serial.println(" C");  
  25.  
  26.   delay(500);
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top