Add the following snippet to your HTML:
How to make auto on/off the light using PIR sensor
Read up about this project on
watch theFull project on youtube.
void setup() { pinMode(7,OUTPUT); pinMode(11,INPUT); } void loop() { // put your main code here, to run repeatedly: int val = digitalRead(11); if( val == 1){ digitalWrite(7, LOW); delay(1000); } else{ digitalWrite(7, HIGH); delay(1000); } }
Comments