Skip to main content

Posts

Featured

Automatic room light, code

void setup() {
pinMode(13, OUTPUT);
pinMode(2, INPUT);
pinMode(3, INPUT);
}

void loop() {
if (digitalRead(2)) {
  while(digitalRead(3)) {

  }
  digitalWrite(13, HIGH);
}
if (digitalRead(3)) {
  while(digitalRead(2)) {

  }
  digitalWrite(13, LOW);
}
while(true) {

}
}

Latest Posts