I'll have to grab it in a bit.New version is up! Tell me all about the new bugs I introduced! :lol:
I'll have to grab it in a bit.
One question I had (and another thing I should probably just look into before asking, but...) is: Is it possible to implement support for holding down the '+' and '-' buttons to speed through the setting? Adjusting the percentage way up or way down by hitting the button 50+ times is annoying. But setting the time, if you've got to change it a long way, one minute at a time is downright frustrating.
If that fails you could always adjust hours, tens of minutes and minutes separately. Also if you can detect + and - pressed at the same time maybe you could reset to 00 or increment by15. Just some thought that might help.
We should have set it with an astronomical clock. We need a redesign
The five minutes is a good idea too. I don't think that many will care if we are off by 2.5 minutes. Oh wait you allow to change seconds don't you?
Started to take a look at it and then I got annoyed at some of the really repetitive code, so I started cleaning it up.I was thinking about this too, there is an "isPressed" return value from the button library we are using, though Im a little sketchy on how to implement it.
If we just say start moving if the button is pressed, getting precise numbers might be a little tough.. I have a feeling the clock speed of the board will make the numbers fly by too fast to deal with so we'd have to only do something every so many cycles.
Give it a try in your arduino editor before you upload to your typhon, replace one of the plus.uniquePress() or minus.uniquePress() with plus.isPressed() or minus.isPressed()
If you're not comfortable making those changes or its giving you unpredictable results let us know.
I'll try it too but I may not get to it before tomorrow morning.
If the code wasn't so repetitive that wouldn't have been a problem. :lol:LOL damn, I thought I got all of those! it's up to date again. This is what happens when you try to a.) program at work while getting interrupted by phonecalls :lol:
typedef struct {
int Led;
EEPROMVar< int > StartMins; // minute to start this channel.
EEPROMVar< int > PhotoPeriod; // photoperiod in minutes for this channel.
EEPROMVar< int > Max; // max intensity for this channel, as a percentage
EEPROMVar<int> FadeDuration; // duration of the fade on and off for sunrise and sunset for
// this channel.
} channelVals_t;
channelVals_t channel[4];
To me, the idea that XSiVE and I discussed a page back is the most promising right now. Use "temporary" variables to store user inputs in the UI menu structure, and then once per cycle copy those values to the "real" variables that were stored in EEPROM and actually controlled the behavior of the output channels. We'd just have to be super-super careful to only write a variable to EEPROM when a value changed. If you wrote it to the EEPROM by default every iteration through the loop, you'd burn the chip out in no time flat.
XSiVE, I haven't actually looked at your "button hold" code yet, but it strikes me that you should be able to totally avoid the use of delays to implement that sort of function. Instead, how about storing the time the button is pressed in a variable, and then each iteration through the loop, check to see if the button is still pressed, and if so, check to see how much time has elapsed since it was first pressed. Then you could change the behavior of the button based on elapsed time, instead of using a delay.
I think you're right...and I think I'm most of the way there. I'll see if I can get the rest of the way.