Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pir = 7;
- int val=0;
- int led=13;
- // motion - task 1
- void setup() {
- pinMode(pir, INPUT);
- pinMode(led, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- val = digitalRead(pir);
- if(val==HIGH) {
- digitalWrite(led, HIGH);
- }
- else {
- digitalWrite(led, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement