Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. int ledPin = 13; // LED conectado ao pino digital 13
  2. int value = LOW; // último valor do LED
  3. long previousMillis = 0; // último momento que o LED foi atualizado
  4. long interval = 1000; // tempo de transição entre estados (milisegundos)
  5. int sensorSUP = 4;
  6. int sensorINF = 3;
  7. int estadoSUP;
  8. unsigned long startTime;
  9. unsigned long stopTime;
  10.  
  11. ////////////////////////
  12.  
  13.  
  14. startTime = millis();
  15. digitalWrite(ledPin, HIGH);
  16. lcd.setCursor(0, 0);
  17. lcd.print("TEMPO DE QUEDA =");
  18. if (digitalRead(sensorSUP) == LOW)
  19. {
  20. stopTime = ( millis() - startTime);
  21. lcd.setCursor(0, 1);
  22. lcd.print(stopTime);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement