I already searched the whole forum but do not find the same problem:
I have 4 buttons: they work each separate, but there should be a combination:
for example:
But 1: LED 1 = on
But 2: LED 2 = on
But 3: LED 3 = on
But 4: LED 4 = on
But 1 and But 2 tighter: set the brightness off the leds... BUT don't turn LED 1 an LED 2 on..
this is what I have so far (without the combination):
//Button 1 is pressed
if ((but1read == HIGH) && ((millis() - but1LastPress) > buttonPressDelay)) {
but1LastPress = millis();
doButton1();
}else if ((but1read == LOW) && ((millis() - but1LastPress) > buttonPressDelay ))
but1LastPress = 0; // reset
//Button 2 is pressed
if ((but2read == HIGH) && ((millis() - but2LastPress) > buttonPressDelay)) {
but2LastPress = millis();
doButton2();
}
else if ((but2read == LOW) && ((millis() - but2LastPress) > buttonPressDelay ))
but2LastPress = 0; // reset
//Button 3 is pressed
if ((but3read == HIGH) && ((millis() - but3LastPress) > buttonPressDelay)) {
but3LastPress = millis();
doButton3();
}
else if ((but3read == LOW) && ((millis() - but3LastPress) > buttonPressDelay ))
but3LastPress = 0; // reset
//Button 4 is pressed
if ((but4read == HIGH) && ((millis() - but4LastPress) > buttonPressDelay)) {
but4LastPress = millis();
doButton4();
}
else if ((but4read == LOW) && ((millis() - but4LastPress) > buttonPressDelay ))
but4LastPress = 0; // reset