#include #include const int NUM_SEG_PINS = 9; const int NUM_DIGIT_PINS = 5; const int segments [] = {7,8,A0, 11, 10, 13, A1, 12, 9}; const int digits [] = {4,6,5,2,3}; NSegmentDisplay disp(true, NUM_SEG_PINS, segments, NUM_DIGIT_PINS, digits); //start time int hr = 11; int mn = 40; const int button1 = A2 ; const int button2 = A3; bool pressed1; bool pressed2; const int buttonDelay = 400; unsigned long lastButtonPress = 0; void setup() { setTime(hr,mn,0,3,16,2023); disp.off(0); pinMode(button1, INPUT_PULLUP); pinMode(button2, INPUT_PULLUP); } void loop () { pressed1 = digitalRead(button1); pressed2 = digitalRead(button2); if (pressed1 == false) { if (millis() > lastButtonPress + buttonDelay) { hr = hourFormat12() + 1; setTime(hr, minute(), 0, 13, 3, 23); lastButtonPress = millis(); } } if (pressed2 == false) { if (millis() > lastButtonPress + buttonDelay) { mn = minute() + 1; setTime(hourFormat12 (), mn, 0, 13, 3, 23); lastButtonPress = millis(); } } if(minute() < 10) { disp.number(1, 0); } disp.multiDigitNumber(minute()); disp.multiDigitNumber(2, hourFormat12()); disp.segment(4,8,3); //colon }