I can't find any information that relates to my problem. The few things I did find confused me (I'm quite new to this).
I'm trying to flash 2 sequences of 4 lights at the same time. I can get 1 set flashing but I don't know how to run other sequences at the same time. My probably laughable attempt at the code is below:
int led1 = D0;
int led2 = D1;
int led3 = D2;
int led4 = D3;
int led5 = D4;
int led6 = D5;
int led7 = D6;
int led8 = D7;
void setup() {
setupPart1();
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
setupPart2();
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
}
void loop() {
loopPart1();
digitalWrite(led1, HIGH);
delay(500); // delayed for half a second
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
delay(500); // delayed for half a second
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
delay(500); // delayed for half a second
digitalWrite(led3, LOW);
digitalWrite(led4, HIGH);
delay(500); // delayed for half a second
digitalWrite(led4, LOW);
loopPart2();
digitalWrite(led5, HIGH);
delay(500); // delayed for half a second
digitalWrite(led5, LOW);
digitalWrite(led6, HIGH);
delay(500); // delayed for half a second
digitalWrite(led6, LOW);
digitalWrite(led7, HIGH);
delay(500); // delayed for half a second
digitalWrite(led7, LOW);
digitalWrite(led8, HIGH);
delay(500); // delayed for half a second
digitalWrite(led8, LOW);
}