I would also remove the Refresh (from DispChar) - and draw all the characters before calling Refresh (the component buffers them)
So Clear Draw(hours), Draw(mins), Draw(secs) Refresh() (or similar)
Martin
MAX7219 32x32 LED Display
-
mnfisher
- Valued Contributor
- Posts: 2039
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 160 times
- Been thanked: 949 times
-
mnfisher
- Valued Contributor
- Posts: 2039
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 160 times
- Been thanked: 949 times
Re: MAX7219 32x32 LED Display
The second 'update' method in the main loop also has an issue.
The 'button' or signal needs to come at exactly the right time... This might not be such an issue if the use presses and holds the button (for longer than - but if it is a digital signal then getting the timing 'just so' is problematic.
I would try using an interrupt to record a button press (A0/A1 changes to high) - and there is a possible need for some debounce if it is a button.
In the button_press ISR -> set_flag = true. This is easiest using INT0 or INT1 on D2 / D3.
Then in program loop..
if set_flag then
setup_RTC
set_flag = false
The 'button' or signal needs to come at exactly the right time... This might not be such an issue if the use presses and holds the button (for longer than - but if it is a digital signal then getting the timing 'just so' is problematic.
I would try using an interrupt to record a button press (A0/A1 changes to high) - and there is a possible need for some debounce if it is a button.
In the button_press ISR -> set_flag = true. This is easiest using INT0 or INT1 on D2 / D3.
Then in program loop..
if set_flag then
setup_RTC
set_flag = false
Re: MAX7219 32x32 LED Display
I think I've found the root of the problem: when I pressed the button in the settings, it didn't increment the variable's value; the calculation was missing: `hour = hour + 1`, `min = min + 1`, ... A trivial mistake...
Re: MAX7219 32x32 LED Display
That's as far as we've gotten so far I'm about to start designing the "custom numbers"
https://youtu.be/Ihku_Cox9Dk
https://youtu.be/Ihku_Cox9Dk