RTC Clock with 4 Digit/7 Segment Display

Hi all, thanks to all the entries on here and all around the place I have made a functioning clock, and rather then stay in the shadows sucking off other peoples work, I thought that I would share my project, and say hi. (I hope this is in the right spot)

The project involved putting a clock in a book. My wife hates the look of alarm clocks, and I needed a project so the idea is to hide the clock in a book on the bedside. I haven't actually implemented an alarm, as the phone (cell, mobile) will do that anyway. My wife is able to bind books, so she is going to create a spine that the led will shine through, and I will cut out the inside of the book to hide the electronics, this is still to be done, but the arduino side of things is more or less complete. During the day, the led clock will turn off between specific times, and at night, the clock will be on, so it will be useful when it needs to be, and otherwise hidden.

I used the following components.

3 x momentary switches
1 x DS3231RTC
1 x 4 digit/7 seg display
and running it all is an arduino pro mini
oh, and there are the appropriate resistors in place on the leds and switches

Both the time and the "off times" can be set by the buttons, and the set modes are accessed by holding the 'set button' for a length of time. The off time is only able to be set to the hour, rather then hour and minute (I didn't see the need to be so specific with this for its use).

when the time is being displayed, the 'up' button gives the current temperature ( a neat little feature of the DS3231). When the time is not being displayed, the up button serves the same function but the down button displays the current time briefly and then returns off.

I am a total amateur at this with this being my second proper project (the first was a child's play oven which used potentiometers to fade red LED oven hot plates, so pretty simple coding) and I imagine my code will reflect this. I would appreciate some ideas for some more efficient coding, though I am happy with my outcome.

_7segclock.ino (8.41 KB)