I just realized I hadn’t posted the last working version of the EEPROM utility program, which you’ll need to run to load up EEPROM before the UI code above can work. Alas that’s now on my home PC which is … at home. So I’ll post that code when I get home and then you can try that (to load the EEPROM) and after that, you can try the UI code above.
There are some things about the UI that need some discussion as I’m unsure about the “best” path to take.
First I’ve set up the UI to mimic what I think the timer code should eventually do, that is store the last CoF used and recall those settings whenever it’s powered up or reset. You could have it, instead, return to some default CoF settings but my guess was that the former was more user friendly. Your thoughts ??
I want the user to have some options when exitting the UI with regards to whether to use the new settings or not, and whether to save them to EEPROM or not. I figured there’s going to be a time when you think you want to change some setting, say time allowed, go into the UI to make the change and then change your mind. You need a way to exit the UI w/o making any changes … so the UI has an exit option to just exit. You may also have the idea that you want to try out some change(s) before you save them away … to see if they “work”. So the UI has an exit option to keep the changes made, exit the UI with them in effect but not saved to EEPROM. Conceivably you could try them out and re-enter the UI and then save them to EEPROM. Lastly the UI has the exit option to exit and save the changes to EEPROM into one the prenamed CoF’s. But there’s a “conflict” with the above and the earlier idea that whatever CoF was last used should be saved somehow and restored upon power up/reset. So do we want to “save” the CoF that was in place if the user “exitted w/o saving” ?? I was trying to make some provision for this with a slot in EEPROM called “Last Used” but now I’m not sure that’s the best thing to do (or how to do it). Perhaps an “unsaved” CoF should just be lost upon power off or reset ??
What resolution to you want to have when setting a time limit via the UI ? Right now it’s 1 whole sec, which is too coarse IMO but is 0.5 secs good enough ? 0.1 secs ?? The “conflict” comes when setting the time with the UI; I have the UI increment the time by whatever the resolution is with each “up button” press (or just hold the “button”). The UI polls the analog inputs every .2+ secs to read the button and do whats commanded. So coarse resolution gets you from 5 secs to 50 secs quickly but a 0.1 sec resolution would take 10x longer. Speeding up the polling would help but then you run into the problem that you can’t press and release the “button” fast enough, you always get a double (or triple) press. Now perhaps some adaptive code that reads the joystick as up and really up (so as to make the increment 5x larger) can be implemented … I just haven’t gotten that far. But is it needed ? Let’s decide on a resolution and then fix whatever user interface problem results.
Do you want a nag prompt before overwriting a CoF ? I thought to make some CoFs edit-able and have others locked out (from the UI) but haven’t implemented this part yet. Perhaps they should all be edit-able from the UI with … or with out … a nag prompt (“Are you sure you want to change this”) before saving to EEPROM ??