Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned long previousMillis ;
- //-----------------------------
- void setup()
- {
- Serial.begin(9600);
- previousMillis = millis(); // Inicialisa o valor de previousMillis
- }
- //------------------------------
- void loop()
- {
- if (millis() - previousMillis > 500) // Testa se adiferença chegou em 500
- { // Se chegou faça
- Serial.println("Maior que 500"); // Imprime
- previousMillis = millis(); // Reinicialise o valor de previousMillis
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement