i made a smiley face out of leds. and i would like to make one eye blink, but when i change the code to make pin 8 blink all the leds blink or they turn on 1 at a time. any suggestions.
// blinking led 1
#define LED 13 //led connected to 13
void setup ()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT); // 11 is output
pinMode(10, OUTPUT); // 10 is output
pinMode(9, OUTPUT); //9 is output
pinMode(8, OUTPUT); // 8 is output
}
void loop()
{
digitalWrite(13, HIGH); // turns led on
delay(3000);
digitalWrite(12, HIGH);
delay(3000);
digitalWrite(11, HIGH); // 11 is on
delay(3000);
digitalWrite(10, HIGH); // 10 is on
delay(3000);
digitalWrite(9, HIGH); // 9 is on
delay(3000);
digitalWrite(8, HIGH); // 8 is on
delay(3000);
digitalWrite(13, LOW); // turn led off
delay(3000);
digitalWrite(12, LOW);
delay(3000);
digitalWrite(11, LOW); // 11 is off
delay(3000);
digitalWrite(10, LOW); // 10 is off
delay(3000);
digitalWrite(9, LOW); //9 is off
delay(3000);
digitalWrite(8, LOW); //8 is off
delay(1500);
}
ive tried both of those and neither do what i want. the bottom one just leaves all the leds lit up.#define LED 13 // defines pin 13 as LED
void setup(){
pinMode(13, OUTPUT); // 13 is output
pinMode(12, OUTPUT); // 12 is output
pinMode(11, OUTPUT); // 11 is output
pinMode(10, OUTPUT); // 10 is output
pinMode(9, OUTPUT); //9 is output
pinMode(8, OUTPUT); // 8 is output
}
void loop(){
digitalWrite(13, HIGH); //13 is on
digitalWrite(12, HIGH); //12 is on
digitalWrite(11, HIGH); // 11 is on
digitalWrite(10, HIGH); // 10 is on
digitalWrite(9, HIGH); // 9 is on
digitalWrite(8, HIGH); // 8 is on
digitalWrite(13, LOW); // 13 is off
digitalWrite(12, LOW); // 12 is off
digitalWrite(11, LOW); // 11 is off
digitalWrite(10, LOW); // 10 is off
digitalWrite(9, LOW); //9 is off
digitalWrite(8, LOW); //8 is off
also this is just a gateway to a much much much much bigger project.