 bool isHeating;
 
 void setup()   {
-  //LCD Setup 
+  //LCD Setup
   lcd.InitLCD();
   lcd.clrScr();
   lcd.setFont(SmallFont);

State stateEnterAnzahlRasten = State(forceFirstDisplay, enterAnzahlRasten, NULL);
State stateDefineRast = State(forceFirstDisplay, defineRast, NULL);
State stateEnterAbmaischTemp = State(forceFirstDisplay, enterAbmaischTemp, NULL);
State stateReachEinmaischTemp = State(prepareReachEinmaischTemp,reachEinmaischTemp,NULL);
State stateEinmaischen = State(einmaischen);
State stateReachRastTemp = State(reachRastTemp);
State stateWaitRastDauer = State(prepareRastDauer,waitRastDauer,NULL);
State stateReachAbmaischTemp = State(NULL,reachAbmaischTemp,NULL);
FSM fsmMaischen = FSM(stateEnterEinmaischTemp);

//Kochen FSM und States definieren
State stateEnterKochzeit = State(forceFirstDisplay, enterKochzeit, NULL);
State stateEnterAnzahlHopfengaben = State(forceFirstDisplay, enterAnzahlHopfengaben, NULL);
State stateDefineHopfengaben = State(forceFirstDisplay, defineHopfengaben, NULL);
State stateDoKochen = State(enterDoKochen,doKochen, NULL);
FSM fsmKochen = FSM(stateEnterKochzeit);

//Timer FSM und States definieren
State stateEnterTimerTime = State(forceFirstDisplay,enterTimerTime,NULL);
State stateDoTimer = State(prepareDoTimer,doTimer,NULL);
FSM fsmTimer = FSM(stateEnterTimerTime);

//Variablen initialisieren

int selectedMenuEntry = 0, menuOffset = 0;
//char* menuEntrys[] = {"Maischen","Kochen","Heizen","Timer","Einstell."};
char* menuEntrys[] = {"Maischen","Kochen","Heizen","Timer"};
float lastTemps[TMP_SMOOTH]={0,0,0,0,0};
float tempTotal = 0;
int temp, lastTemp, sollTemp, lastHeatCheckTemp, tmpIndex=0;

unsigned long lastRest = -1;
unsigned long dauer = 0;


//Main FSM und States definieren
State stateMenu = State(enterMenu, menu, leaveMenu);
State stateError = State(enterError, error, NULL);
State stateMaischen = State(enterMaischen, maischen, leaveMaischen);
State stateKochen = State(enterKochen, kochen, leaveKochen);
State stateHeizen = State(enterHeizen, heizen, leaveHeizen);
