Created
November 16, 2016 02:04
-
-
Save edgardmota/96a16c356ab3de1b1512dcd38442e8fb to your computer and use it in GitHub Desktop.
This file contains 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
const unsigned long MILI_MAX = 4294967295; | |
const unsigned long MILI_30_DIAS = 2592000000; | |
unsigned long mili_ant = 0; | |
unsigned long mili_atual; | |
unsigned long mili_dif; | |
void loop(){ | |
mili_atual = millis(); | |
if (mili_atual > mili_ant) | |
mili_dif = mili_atual - mili_ant; | |
else | |
mili_dif = (MILI_MAX - mili_ant) + mili_atual; | |
if (mili_dif >= MILI_30_DIAS) { | |
mili_ant = milli(); | |
alterna_unidades_refri(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment