So, im getting closer - buth still missing something...
Now i sometimes can activate the "Cases", buth noth Step-By-Step, buth i can sometimes toggle from Case 0 to 1, and back, or Run from case 1-8 (Fast), with no stops...
So i guess my "ButtonCounter" dont work!
I have this settings in the button counter:
//ButtonPin4Change
int buttonPushCounter = 0;
int buttonState = 0;
int lastButtonState = 2;
void loop() {
buttonState = digitalRead(BUTTON_PIN4);
if (buttonState != lastButtonState) {
if (buttonState == 0) {
buttonPushCounter+1;
}
delay(50);
lastButtonState = buttonPushCounter;
if(digitalRead(BUTTON_PIN1) == HIGH && digitalRead(BUTTON_PIN2) == HIGH && digitalRead(BUTTON_PIN3 == LOW && digitalRead(BUTTON_PIN5) == HIGH))
{
switch (buttonPushCounter)
{
case 0:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(128, 255, 0));
break;
case 1:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,16, CRGB(0, 0, 255));
break;
case 2:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,32, CRGB(0, 0, 255));
break;
case 3:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,48, CRGB(0, 0, 255));
break;
case 4:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,64, CRGB(0, 0, 255));
break;
case 5:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,80, CRGB(0, 0, 255));
break;
case 6:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,96, CRGB(0, 0, 255));
break;
case 7:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,112, CRGB(0, 0, 255));
break;
case 8:
fill_solid(leds,NUM_LEDS, (0, 0, 0));
fill_solid(leds+128,128, CRGB(0, 255, 0));
fill_solid(leds+0,128, CRGB(0, 0, 255));
break;
default:
break;
}
}