I am monitoring several pins with digitalRead. They are all INPUT_PULLUP, so they read fine. All functions that depend on one Val to go LOW work fine.
Now I am trying to execute a function (PiruetteFunction) when I got 2 LOWs. It simply wont execute.
Please help.
Here is the if else portion of the code.
if ((PS3.getButtonClick(CIRCLE)) || (RightVal == LOW && LeftVal == HIGH ))
{ Serial.println(F("\r\nCircle"));
TurnRightFunction();
}
else if ((PS3.getButtonClick(CROSS)) || (LeftVal == LOW && RightVal == HIGH))
{
Serial.println(F("\r\nCROSS"));
TurnLeftFunction();
}
else if (BackVal == LOW){
StepBackFunction();
}
else if (ForeVal == LOW){
StepAheadFunction();
}
else if (ForeVal == 0 && BackVal == 0 && ForeVal == 1 && BackVal == 1 && DanceVal == 1){
PiruetteFunction();
}
else if (DanceVal == LOW || PS3.getButtonClick(L1)){
DanceFunction();
}
else if (SleepVal == LOW || PS3.getButtonClick(L1)){
delay (1000);
StepBackFunctionShort();
delay(21000);
}
else {
Marching (); // function for marching fwd and back . It will stay put if hat is in the middle.
}