Stap 3: Codering Arduino
#include < vloeibare crystal.h >
float temp; int temppin = 0; int in1 = 7; int in2 = 8; LiquidCrystal lcd (12, 11, 5, 4, 3, 2); void setup {lcd.begin (16, 2); Serial.begin(9600); pinMode (in1, OUTPUT); pinMode (in2, OUTPUT); } void loop {temp=analogRead(temppin); temp temp = * 0.48828125 met lcd.setCursor (0, 1); lcd.println(temp); lcd.print("*f"); delay(500); if(temp<100) {digitalWrite(in1,HIGH); digitalWrite(in2,LOW);} if(temp<90) {digitalWrite(in1,HIGH); digitalWrite(in2,LOW); delay(1500); digitalWrite(in1,LOW); digitalWrite(in2,LOW);} if(temp<80) {digitalWrite(in1,HIGH); digitalWrite(in2,LOW); delay(1000); digitalWrite(in1,LOW); digitalWrite (in2 LAAG); } anders; {digitalWrite(in1,HIGH); digitalWrite(in2,LOW); delay(1500); digitalWrite(in1,LOW); digitalWrite(in2,LOW);} }