francobonelli

I just recently got the Uno and am working my way though the book.I have successfully coded Projects 5 & 6 but was wondering what is the best way to link them both so they loop after each other.

So,far I have merged the codes but when I run it....they dont loop after one another but the 1st loop gets so far then the 2nd starts.Then the 1st finishes and restarts and the 2nd one comes in intermittently.It is very erratic.

So,basically I want to have a loop that runs the Chase Led sequence 1st fully,then the Bounce sequence fully and the Chase again and so on........

digitalWrite(ledPin[currentLED1],HIGH); //turn on the current led digitalWrite(ledPin2[currentLED2],HIGH); currentLED1 += directionleft; //increment by the direction value currentLED2 -= directionright;