B1 { if(motorsPulsingEnabled == 1) { if (motorStateMachine == 0) turn on motor1 if (motorStateMachine == 1) turn off motor1 if (motorStateMachine == 2) turn on motor2 ...etc... motorStateMachine++; if (motorStateMachine > SOME_VALUE) { motorStateMachine = 0; } } } else { motorStateMachine = 0; } }