//JatanPandya //297 //Mr. Charles Malloch, PhD #include #define motorPin 10 float TempValue, TempValueC, TempValuemv; const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { pinMode(A0,INPUT); pinMode(motorPin,OUTPUT); analogWrite(motorPin,0); Serial.begin(9600); } void loop() { TempValue=analogRead(A0); TempValuemv=TempValue*5000/1024; TempValueC= (TempValuemv/10)+(-50); Serial.println(" °C "); Serial.print(TempValueC); lcd.begin(16, 2); lcd.print(TempValueC); lcd.print(" Celcius "); lcd.noDisplay(); delay(500); lcd.display(); delay(500); delay(1000); float temp[]={22,23,24,25,26,27,28}; char ch=(TempValueC); if (ch<= 25.0){ int speed = ch - 0 ; int ch = map ( speed, 18.0, 25.0, 0, 255 ); analogWrite(motorPin, ch); } }