 // PWM  *****************************************************************
 
 // initialize the timer1 interrupt for the frequency variable output
- Timer3.initialize(33333);                   // initialize timer1, and set a 33.333ms period -> 30Hz
+// Timer3.initialize(33333);                   // initialize timer1, and set a 33.333ms period -> 30Hz
  
 //   Timer3.pwm(RELAIS_HEATER, pwmDuty);     // setup pwm on pin 9, 50% duty cycle
 

                          digitalWrite(GREEN_LED_PIN, LOW);
                          delay (1000);  
  }
      else if(LowerLevel < getTemperatureOven() <= HigherLevel)     
         {              
       //   Timer3.pwm(RELAIS_HEATER, pwmDuty, 8000000);    // 50% dutycycle pwm an pin heater, 8s Periode, pwmDuty2 = 25% 

                          #ifdef DEBUG
                          Serial.println(F("Pulsed signal"));
                          #endif


                currentMillis = millis();

                if ((currentMillis - previousMillis) >= intervalHigh) {     
                   if (ovenState) {
                          #ifdef DEBUG
                          Serial.println(F("heater stop"));
                          #endif
                          
                         digitalWrite(RELAIS_HEATER, LOW);
                         displayCommandSmall1("Low");
                         digitalWrite(RED_LED_PIN, LOW);
                         previousMillis = currentMillis;
                         ovenState = false;
                  } 
                  else if ((currentMillis - previousMillis) >= intervalLow) {

                          #ifdef DEBUG
                          Serial.println(F("heater on"));
                          #endif
                          
                          digitalWrite(RELAIS_HEATER, HIGH);
                          displayCommandSmall1("High");
                          digitalWrite(RED_LED_PIN, HIGH);
                          previousMillis = currentMillis;
                          ovenState = true; 
                  }
              } 

            
           digitalWrite(GREEN_LED_PIN, HIGH);
           digitalWrite(RED_LED_PIN, LOW);
           
        }  

      else if ((getTemperatureOven() >= getTemperatureOvenSetPoint()+3) || (getTemperatureMeat() >= getTemperatureMeatSetPoint()))
          {

                          #ifdef DEBUG
                          Serial.println(F("Pulsed signal and heater stop"));
                          #endif
  
           // Timer3.disablePwm(RELAIS_HEATER);
            digitalWrite(RELAIS_HEATER, LOW);
            digitalWrite(RED_LED_PIN, HIGH);
            digitalWrite(GREEN_LED_PIN, LOW);
            ovenState = false;
          }

                        //  #ifdef DEBUG
                       //   Serial.println(F("heater stop"));
                         // #endif
                         
//                    Timer3.disablePwm(RELAIS_HEATER);
//                    digitalWrite(RELAIS_HEATER, LOW);
//                    digitalWrite(RED_LED_PIN, HIGH);
//                    digitalWrite(GREEN_LED_PIN, LOW);
                     










static stm_substate_t         stm_SubState;
static stm_substate_time_t    stm_time_SubState;


// Private function prototypes ***********************************************
