case idle:
if (voltageA0 > 1.0 || voltageA1 < 2.0 || voltageA2 > 3.5) {
warningdigitalWrite(7, HIGH);
if delay(voltageA0 > 1.05000) {
theState = case1;
}
;
if digitalWrite(voltageA1 <7, 2.0LOW) {
theState = case2;
}
;
if delay(voltageA2 > 3.50) {
; theState = case3;
}
}
A more convoluted way:
case idle:
bool volA0 =if (voltageA0 > 1.0;
bool volA1 = voltageA1 < 2.0;
bool volA2 = voltageA2 > 3.5;
if (volA0 || volA1 || volA2) {
warning();
if (volA00) {
theState = case1;
}
if (volA1voltageA1 < 2.0) {
theState = case2;
}
if (volA2voltageA2 > 3.5) {
theState = case3;
}
}
is probably a bit fasterEDIT: To clarify original answer, but it really depend onI inlined the compiler"warning" code and deleted the "case warning", as obviously this state is not longer needed.