I went and added some more features to the clock today, including:
- A feature that dims all light-emitting elements on the PCB, including the seven-segment displays and discrete LEDs. I figured this would make it a more practical alarm clock, as the brightness might make sleeping next to it an issue. This is activated by pushing SW7.
- Any button will bring the clock out of this dim mode. Alarms going off will automatically end the dim mode.
- All switches will now snooze the alarm if it goes off - except for SW8, which turns off the alarm.
- The display now flashes when the alarm goes off as an additional indicator that you have to wake up.
- Changed the way LEDs update: this is now updated periodically during a 4ms periodic refresh i.e. conditions are checked and LEDs are illuminated accordingly. This removes the need to update LEDs whenever modes are switched.
- Refresh rate of the screen was bumped from ~50 Hz to ~60 Hz. Originally, refresh rate was on a 5ms periodic timer in which the digit to be illuminated would switch every 5ms - this results in a 20ms period to refresh all LEDs, in turn resulting in a ~50 Hz refresh period. This has been updated to be a 4ms periodic timer to bring the refresh rate higher to ~ 60 Hz
The updated code is in the files section.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.