Closed BzowK closed 3 years ago
Hi, let's see if I can help.
For your issue:
just MOVE the line
if (hour(now()) >=12) adjustTime(-43200); // 43200 seconds = 12 hours
as the first instruction in function void capturetime(). Like this:
void capturetime() {
if (hour(now()) >=12) adjustTime(-43200); // 43200 seconds = 12 hours
moment[0] = hour(now()) / 10; // find out first digit from hour
This should do it. Unfortunately, I cannot test on my installation.
For your question:
I don't get this:
if ((hour(now()) < 1)) { // if hour is "0", displays a "12"
moment[0] = 1;
moment[1] = 2;
}
exchange it with these lines an the leading zero should dissapear
if (hour(now()) < 10) { // if leading zero
moment[0] = 10; // 10 is defined as all servos down
}
For your suggestion:
I like the idea of the OTA approach. Please use the "Fork" function on the top right in GitHub to generate your own fork to share an maintain you own code.
Hope this works. Marc
Thanks so much for your reply and assistance!
I'll give the code a shot tomorrow and let you know the results. Will start a fork as well in case it helps anyone else. Thanks again for the help!
Both solutions worked like a champ - Thanks again!!
You're welcome.
Hey!
Had to put project aside for a while, but finished it up recently and love it. Thanks a lot for taking time to code the way you did. I did have an issue, a question, & a suggestion I've been meaning to post about, though. Any assistance would be greatly appreciated...
The Issue Time Correctly Sets to a 12 Hour clock if powered on in PM hours. If powered on in AM hours, it shows 24 hour clock after noon. Resetting power shows time with 12 hour clock again as it should. In other words, if powered on in the AM, once it's 1:00pm, it shows 13:00. Cycling the power (correctly) shows it is 1:00
I have the below line at the end of the get_NTP_time function but seemingly only runs it once when powered on. Looks to me like it should be in the loop, but no coding expert :)
...Entire code below...
The Question Since I use a 12 hour clock, I obviously only use the first digit / 8 servos for the occasional "1". I've tried editing the code to make the first digit display nothing (all servos in off position) instead of a "0" when the time not "11" or "12", but have so far been unsuccessful. Would this be an easy change or no?
The Suggestion My clock required a lot of fine-tuning which obviously requires removing from wall, disconnecting the power from the servo boards (I put a switch in as suggested), etc. I instead added in code to use OTA to perform flashes which works great. If you'd like to add (or not), I've attached my current sketch.
Any suggestions would be appreciated - Thanks!