PIR Code

int pirPin = 4; void setup() { pinMode (pirPin, INPUT); Serial.begin(9600); } void loop() { int sensorValue = digitalRead (pirPin); if (sensorValue == HIGH) { Serial.println("Intruder!"); delay(100); } else { Serial.println("All Clear"); } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.