#include <Arduino.h>
#include "MyClock.h"
#include "MyLCD.h"
#include "MyBreaker.h"
#include "MyKeypad.h"
#define PIN_BREAKER 8 // Change to your setup
byte rowPins[] = {4, 5, 6, 7}; // Change to your setup
byte colPins[] = {1, 0, 3, 2}; // Change to your setup
MyClock myClock;
MyLCD myLCD;
MyBreaker myBreaker(PIN_BREAKER);
MyKeypad myKeypad(rowPins, colPins);
bool countdownMode = false;
void setup() {
Serial.begin(115200);
myLCD.initialize();
myClock.initialize();
}
void loop() {
if (countdownMode) {
// Handle countdown logic here
// Check for keypad inputs to control countdown
char keyPressed = myKeypad.getKey();
if (keyPressed != NO_KEY) {
// Handle keypad inputs for countdown control
}
} else {
// Display regular clock and handle keypad inputs for switching to countdown mode
char keyPressed = myKeypad.getKey();
if (keyPressed == 'B') {
countdownMode = true;
// Initialize countdown settings
}
}
// Display clock or countdown on LCD based on countdownMode
if (countdownMode) {
// Display countdown on LCD
} else {
// Display clock on LCD
}
}
<------- Set Alarm
<------- Set Clock
|
^
------------------------------ Submit / Silence Alarm
Erase / Snooze-----------------
^
|