void change_status() {
state = state+1 ;
if
(state >= 4) { // Wenn Status > 4 ,dann ...
state = 0 ; // ... Status zurücksetzen , default = 0
}
}
if (state == 0) // Wenn Zähler gleich null
{
lcd.clear();
// set up the LCD's number of columns and rows:
// Print a message to the LCD.
lcd.setCursor(3, 0);
lcd.print(clock.dateFormat("d-m-Y", dt));
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(4, 1);
// print the number of seconds since reset:
lcd.print((clock.dateFormat("H:i:s", dt)));
}
if (state == 1) // Wenn Zähler gleich 1
{
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("LUFTDRUCK");
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(3, 1);
// print the number of seconds since reset:
lcd.print(pressure_hPa);
lcd.print("hPa");
}
if (state == 2) // Wenn Zähler gleich 1
{
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("LUFTFEUCHTIGKEIT");
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(3, 1);
// print the number of seconds since reset:
lcd.print(humidyDHT22);
lcd.print("%");
}
if (state == 3) // Wenn Zähler gleich 1
{
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("TEMPERATUR.");
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(3, 1);
// print the number of seconds since reset:
lcd.print(tempDHT22);
lcd.print("°C");
}
if (state == 4) // Wenn Zähler gleich 1
{
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("HELLIGKEIT");
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(3, 1);
// print the number of seconds since reset:
lcd.print(helligkeit);
}
}
}
}
Da ist es.... und die change_status() funktioun wird durch pintointerrupt ausgelöst