Tag Archives: blinking

Ooo ooO

a tad complicado

Caleb and I made TWO separate switches with TWO separate LEDs that blinked at TWO separate speeds.

CODE//

void setup(){
pinMode(7,OUTPUT);
pinMode(10, OUTPUT);
pinMode(8,INPUT);
pinMode(9,INPUT);
}

void loop(){

if (digitalRead(8) == HIGH){
digitalWrite(7,HIGH);
delay(300);
digitalWrite(7,LOW);
delay(300);
}

if (digitalRead(9) == HIGH){
digitalWrite(10,HIGH);
delay(100);
digitalWrite(10,LOW);
delay(100);

}
}

 

CODE//

void setup(){
pinMode(7,OUTPUT);
pinMode(10, OUTPUT);
pinMode(8,INPUT);
pinMode(9,INPUT);
}

void loop(){

if (digitalRead(8) == HIGH){
digitalWrite(7,HIGH);
delay(300);
digitalWrite(7,LOW);
delay(300);
}

if (digitalRead(9) == HIGH){
digitalWrite(10,HIGH);
delay(100);
digitalWrite(10,LOW);
delay(100);

}
}