After each button press I want the LED's to go on on 1 by 1, so the sequence would be something like this.
1-2-3-1-2-3
I've already created the first part, but I don't really know yet how to go about making this.
const int PIN_LED_RED = 4;
const int PIN_LED_GREEN = 5;
const int PIN_LED_BLUE = 6;
const int PIN_BUTTON_1 = 8;
const int PIN_BUTTON_2 = 9;
int buttonState_1 = 0;
void setup() {
Serial.begin(9600);
pinMode(PIN_LED_RED, OUTPUT);
pinMode(PIN_LED_GREEN, OUTPUT);
pinMode(PIN_LED_BLUE, OUTPUT);
pinMode(PIN_BUTTON_1, INPUT_PULLUP);
pinMode(PIN_BUTTON_2, INPUT_PULLUP);
}
void loop() {
buttonState_1 = digitalRead(PIN_BUTTON_1);
if (buttonState_1 == LOW)
{
digitalWrite(PIN_LED_RED, HIGH);
digitalWrite(PIN_LED_GREEN, LOW);
}
}