/*************************************************
* Programm: Display Statemaschine *
* Name: Suppaner Felix *
* Klasse: 2AHME *
* Datum: 25.04.2024 *
*************************************************/
#include <Wire.h>
#include <LiquidCrystal.h>
#define BACKLIGHT_PIN 3
#define BUTTON_PIN 2
int state = 1;
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
int count = 0;
unsigned long lastCounterUpdate = 0;
#define TASTER 5 //Taster
void setup()
{
lcd.init();
lcd.backlight();
pinMode(TASTER , INPUT_PULLUP);
}
void loop()
{
switch(state) //Statemaschine
{
case 1: //Zustand 1
lcd.setCursor(1,0); //Courser setzten
lcd.print("Messung Inaktiv"); //Text schreiben
lcd.setCursor(1,1); //Courser setzten
lcd.print(" "); //Text schreiben
{
state=2;
}
break;
/*----------------------------------*/
case 2: //Zustand 2
count++;
delay(1000); //Warte 1s
lcd.setCursor(1,0); //Courser setzten
lcd.print("Messung Aktiv "); //Text schreiben
lcd.setCursor(1,1); //Courser setzten
lcd.print(ausgabe); //Text schreiben
lcd.setCursor(10,1); //Courser setzten
lcd.print(count); //Text schreiben
lcd.print(" s "); //Text schreiben
{
state=1;
count=0;
}
break;
}
}