#include <LiquidCrystal.h> #include <Servo.h> Servo myservo; LiquidCrystal lcd(7, 8, 9, 10, 11, 12); int tolerance = 10; int potpin = A1; int val; const float vf0 = 381.60; //k const float vf0d = 610.61; int i; //k int ii; float dtemp, dtemp_avg, tempk; //k float dtempd, dtempd_avg, td; void setup(){ lcd.begin(16, 2); // intialise the LCD pinMode(A0,INPUT); pinMode(A1,INPUT); Serial.begin(9600); myservo.attach(3); } void loop(){ delay(3); int temp = tempk+td; dtemp_avg = 0; for (i = 0; i < 1024; i++) { float temp_k = analogRead(A0) * (5070.00 / 1023.000); //k dtemp = (temp_k - vf0)/3.00; dtemp_avg = dtemp_avg + dtemp ; } tempk = dtemp_avg / 1024; dtempd_avg = 0; for (ii = 0; ii < 1024; ii++) { float temp_d = analogRe...
Kommentit
Lähetä kommentti