#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int hours = 17;
int minutes = 15;
int a = 0;
int alarm_hours = 20;
int alarm_minutes = 30;
const int BUTTON_1 = 23;
const int BUTTON_2 = 25;
const int BUTTON_3 = 27;
const int BUTTON_4 = 29;
const int CLOCK_STATE = 0;
const int CONFIG_STATE = 1;
const int ALARM_STATE = 2;
int state = CLOCK_STATE;
void setup()
{
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(BUTTON_1, INPUT_PULLUP);
pinMode(BUTTON_2, INPUT_PULLUP);
pinMode(BUTTON_3, INPUT_PULLUP);
pinMode(BUTTON_4, INPUT_PULLUP);
lcd.init();
lcd.backlight();
}
void loop()
{
lcd.clear();
if (state == CLOCK_STATE)
{
lcd.setCursor(0,0);
lcd.print(hours);
lcd.setCursor(2,0);
lcd.print(":");
lcd.setCursor(3,0);
lcd.print(minutes);
lcd.setCursor(0,1);
lcd.print("by Yaroslav");
delay(1000);
}
}