Timeline for Programming Arduino Uno R3 to trigger a relay once every 24 hours
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 5, 2020 at 8:51 | vote | accept | Felix0004 | ||
| Sep 4, 2020 at 8:55 | comment | added | Felix0004 | Update: I tested the project for a full 24 hours from 9:03 PM Wednesday evening since i powered the arduino on to the next day thursday evening and i noticed it shifted/delayed around 3 minutes, cause it triggered the relay at around 9:06 PM (so thats around 3 mins delay) so 3 mins shift * 30 days a month = 90 mins (an hour and a half timing shift each month) I'm going to test it for another 24 hours now and see... | |
| Sep 3, 2020 at 7:51 | comment | added | StarCat | @EdgarBonet, That's true of course. My opinion is that explicitly casting, where appropriate, doesn't hurt and will prevent hard to find errors in cases where it's not so clear-cut (like in your example). I've expanded the explanation in the answer. | |
| Sep 3, 2020 at 7:50 | history | edited | StarCat | CC BY-SA 4.0 |
Expanded explanation of type casting
|
| Sep 2, 2020 at 20:18 | comment | added | Edgar Bonet |
The "UL" suffix is not needed, as the compiler will pick a data type large enough to hold the value. It is needed though, at least for the first factor, if you want to write an expression like 24UL * 60 * 60 * 1000.
|
|
| Sep 2, 2020 at 17:00 | comment | added | Felix0004 | Thank you very much StarCat I have arduino uno R3 (revision three) and I see a rectangular crystal on the board, So I guess its as accurate as you described....1 second per day thats around 365 seconds ( 6 minutes) per year...so thats fine. And I will use the UL Unsigned Long extension on my code..better, Even if it works with normal delay() without assigning this data type. I Appreciate your input And the article link you posted about doling multiple things at once while program wait is very helpful, Thank you very much | |
| Sep 2, 2020 at 16:41 | history | edited | StarCat | CC BY-SA 4.0 |
added 66 characters in body
|
| Sep 2, 2020 at 16:34 | history | answered | StarCat | CC BY-SA 4.0 |