Finally got all the button code working (at least initially) and put it all together and... the cheap keyswitches I found in my ex's box o'whatever components don't work well at all. I took one apart and found the keyswitch I was using is a terrible design and just can't be relied on. I bought some Cherry MX browns and plan to redesign the button mount to work with the slightly different form factor switch and 3d print that soon.
One of the keyswitches worked though, so currently I'm using that as the Settings button. This functions to wake up the clock. I can configure the wake time anywhere from 1-600 minutes, I've got it set to 60 minutes to save tube life. The brightness is also configurable - 8 different levels of it.
I'm storing the wake time and the brightness in the RAM of the DS1307 so that even when you power off the clock it will reload the settings.
Button functions:
- Press settings button to wake up clock.
- Pressing the settings button while awake enables you to set (in order):
- Hours
- Minutes
- Seconds
- Year (2000-2099)
- Month
- Day
- Brightness (8 levels)
- Wake period (How long the clock stays on until it auto-shuts off)
- Moving to the next setting saves the value. Not pressing any buttons for 10 seconds cancels the most recent changes and exits settings mode.
- Press and hold the settings button for 3 seconds to put it back to sleep early.
- Use the advance (12:05) and decrease (11:55) to move forward and backwards through values.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.