예제 #1
0
void StateMachineHelper::updateDesinfectionSequence(int sequenceId, boolean update)
{
  if (!update)
  {
    return;
  }
  
  switch (sequenceId)
  {
    case 0: // desinfection
    {
      digitalWrite(ProgramConstants::_flushingLight, LOW);
      digitalWrite(ProgramConstants::_desinfectionLight, HIGH);
      printToFirstLine("Program: desinf.");
      printToSecondLine("running");
      break;
    }
    case 1: // ending desinfection - manually select end
    {
      _desinfectionLight = state.blinkLigth(_desinfectionLight, ProgramConstants::_desinfectionLight);
      break;
    }
    case StateMachine::_manullyToNextSequence:
    {
      printToSecondLine("press enter");
      // overrwrite this function to allow manually move to next sequence
      _allowNewProgramSelection = true;
      _waitForManuallTrigger = true;
      
      break;
    }
    case StateMachine::_cycleEnd:
    {
      _stopEverything = true; // machine is prepared to be switched off when desinfection process ends
      //printToFirstLine("Desinf. end");
      printToSecondLine("completed");      
      break;
    }
    default:
    {
      printToSecondLine("Error: Desinf.");
      digitalWrite(ProgramConstants::_errorLight, HIGH);
      delay(20000);
      break;
    }
  }
}
예제 #2
0
unsigned long StateMachineHelper::blinkLigth(unsigned long milliSecs, int pin)
{
  return state.blinkLigth(milliSecs, pin);
}