Dear Rob Tillaart,
dear fellow Dutchman, and of other tinkerers!
good morning, I had some experiences with the Andrew Mascolos countdowntimer(see working example further down below) and had some problems with resetting my Teensy4.0 during the countdownTimer.
my teensy runs with a st7735 and a incremental encoder and a ws2811 slab of 8x8 leds. and I would like to use a long press pushbutton to reset the Countdowntimer, even during the running of the countdown
i would like to use your code and adapt it, and to see if it makes a difference in encoder working, and tft screen functionality.
i use a menu to set (single click) (double click to go up),hold (should be for resetting the countdown)
Red Color
Green Color
Blue Color
Days
Hours
Minutes
Seconds
OnTime
OFFTime
second function runs parallel with the menu
and writes the values on the screen given in with the incremental encoder and to the appropriate functions like countdownTimer
at the last step it executes the set values to the ws2811 leds, independent On and OFF during the given timestamp of days,hours,minutes,seconds.
however it hasnt been impossible for me to reset or stop the countdown loop, except unplugging the teensy from the power, i could build in a hard pushbutton reset, but i would like to have a more clean easy approach.
dear Rob, looking at your code i would like to ask if this is possible.... and had a few questions which you could most probably could answer.
first question: does it matter where i place the CD.start?
second question: lets say if the CD.start is placed in menu 10; does it execute immediately or does it start counting?
third question: using your code (CountdownExample_robTTilaart) with the delay part for the countdowntimer i subsituted it with millis and it automatically runs to 1421141 large value, how can i circumvent this problem, because I dont want to stop my tft st7735 screen doing animations.
question4: if I implement this code, how do i sync this timestamp on the tft display with millis ?
many thanks for looking into this.
Test_28_01_2020.ino (14.2 KB)