Last active
July 10, 2021 18:47
-
-
Save radames/03caf6af0aac2b2c30aa to your computer and use it in GitHub Desktop.
Simple Arduino Hour Minute counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| long lastTime = 0; | |
| long minutes = 0; | |
| long hours = 0; | |
| void setup() { | |
| } | |
| void loop() { | |
| if(millis()-lastTime > 60000){ | |
| minutes++; | |
| lastTime = millis(); | |
| } | |
| if(minutes > 60){ | |
| hours++; | |
| minutes = 0; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment