Add new file

parent 624b172e
#include <dht.h>
dht PIR;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(2,INPUT);
pinMode(9,OUTPUT);
pinMode(3,INPUT);
pinMode(10,OUTPUT);
pinMode(4,INPUT);
pinMode(11,OUTPUT);
pinMode(5,INPUT);
pinMode(12,OUTPUT);
pinMode(6,INPUT);
pinMode(13,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
//dht 11 sensor val
int val = PIR.read11(7);
int val2 = digitalRead(2);
int val3 = digitalRead(3);
int val4 = digitalRead(4);
int val5 = digitalRead(5);
int val6 = digitalRead(6);
if(val2 == 1){
digitalWrite(9,HIGH);
}
else{
digitalWrite(9,LOW);
}
if(val3 == 1){
digitalWrite(10,HIGH);
}
else{
digitalWrite(10,LOW);
}
if(val4 == 1){
digitalWrite(11,HIGH);
}
else{
digitalWrite(11,LOW);
}
if(val5 == 1){
digitalWrite(12,HIGH);
}
else{
digitalWrite(12,LOW);
}
if(val6 == 1){
digitalWrite(13,HIGH);
}
else{
digitalWrite(13,LOW);
}
//for humidity controller and temprature capture
Serial.print("Temperature = ");
Serial.print(PIR.temperature);
Serial.print("\t Humidity = ");
Serial.println(PIR.humidity);
delay(1000);
}void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment