Stap 3: Code!!!
de code is:-
[CODE /]
#include
LiquidCrystal lcd (7, 6, 5, 4, 3, 2);
int ledpin = 9;
VOID Setup {}
Serial.begin(9600);
LCD.begin (16, 2);
}
void loop {}
int sensorValue = analogRead(A5);
sensorValue = kaart (sensorValue, 20, 0, 3, 1000);
Als (sensorValue > 60) {}
LCD.Print ("beweging gedetecteerd");
lcd.setCursor(0,1);
LCD.Print(sensorValue);
}
Serial.println(sensorValue);
sensorValue = kaart (sensorValue, 0, 1000, 0, 255);
analogWrite(ledpin,sensorValue);
delay(50);
LCD.Clear();
}
[/ CODE]