Jugaadu met one of his old friend- Arjun. Jugaadu finds out that his pet- Bruno has left the house as the door was left open. Arjun has to search for his pet every time. Even earlier his pet tried getting outside the house many times. Arjun was tired of it and he wanted Jugaadu to help him. Jugaadu is making a system for the door to resolving this issue?
Bag Items:
int out = 8;
int led= 11;
void setup() {
// put your setup code here, to run once:
pinMode(out,INPUT);
Serial.begin(9600);
pinMode(led,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(out)==LOW){
digitalWrite(led,HIGH);
}else{
digitalWrite(led,LOW);
} }