Go Down

Topic: Can't write multiple pins HIGH why? (Read 2 times) previous topic - next topic

steinklatre

Here is my code:

Code: [Select]
int ledI = 13;
int ledL = 12;
int ledO = 11;
int ledV = 10;
int ledE = 9;
int ledY = 8;
int ledo = 7;
int ledU = 6;

void setup() {               
 
  pinMode(ledI, OUTPUT); 
  pinMode(ledL, OUTPUT);
  pinMode(ledO, OUTPUT);
  pinMode(ledV, OUTPUT);
  pinMode(ledE, OUTPUT);
  pinMode(ledY, OUTPUT);
  pinMode(ledo, OUTPUT);
  pinMode(ledU, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  delay(100);
  digitalWrite(ledI, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(ledI, LOW);    // turn the LED off by making the voltage LOW
  delay(3000);               // wait for a second
  digitalWrite(ledL, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(ledL, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
  digitalWrite(ledO, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);               // wait for a second
  digitalWrite(ledO, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
  digitalWrite(ledV, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);               // wait for a second
  digitalWrite(ledV, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
  digitalWrite(ledE, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);               // wait for a second
  digitalWrite(ledE, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
  digitalWrite(ledY, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);               // wait for a second
  digitalWrite(ledY, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
  digitalWrite(ledo, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);               // wait for a second
  digitalWrite(ledo, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
  digitalWrite(ledU, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);               // wait for a second
  digitalWrite(ledU, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}


I then wanted the led I, L, O, V, E, Y, o, U to write high and tried to use digitalWrite but it errored on me. What should I use in its place?

Thanks
Patience.....

Jack Christensen


I then wanted the led I, L, O, V, E, Y, o, U to write high and tried to use digitalWrite but it errored on me. What should I use in its place?


What is the error? It compiles fine for me.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

PaulS

Quote
What should I use in its place?

Your wife/girlfriend/whatever is going to fall asleep waiting for the end of that cycle. Why such a long delay between changes?

Jack Christensen


Quote
What should I use in its place?

Your wife/girlfriend/whatever is going to fall asleep waiting for the end of that cycle. Why such a long delay between changes?


Perhaps the focus is not completely on the microcontroller, between delays.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Retroplayer

Unless there is a typo I am missing, your code should run fine. I agree though, your delays are really long. lol.

Did you really intend it to take 30 seconds to cycle through one loop?

Go Up