Devices & Components
Arduino Uno Rev3
LED (generic)
Jumper wires (generic)
PIR Sensor, 7 m
L:DR module
Hardware & Tools
Multitool, Screwdriver
Software & Tools
Arduino IDE
Project description
Code
Home automation
arduino
1void setup() { 2 pinMode(13,OUTPUT); 3 pinMode(8,INPUT); 4 pinMode(7,INPUT); 5} 6 7void 8 loop() { 9 int val = digitalRead (8); 10 int light = digitalRead(7); 11 12 13 if (light == 1) 14 if (val == 1){ 15 digitalWrite(13,HIGH); 16 } 17 else{ 18 19 digitalWrite(13,LOW); 20 } 21} 22
Downloadable files
Home automation
if your project doesn't work try changing the values in the sensors
Home automation
Home automation
if your project doesn't work try changing the values in the sensors
Home automation
Comments
Only logged in users can leave comments