Advertisement
RuiViana

Pisca_Analogico

Jan 8th, 2016
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1.  
  2. #define LED 5 // LED no port 5 HIGH = ligado
  3. #define Entrada A0 // Entrada analógica
  4.  
  5. unsigned int Valor = 0;
  6. //----------------------------------------------
  7. void setup()
  8. {
  9. pinMode(LED,OUTPUT); // LED como saída
  10. digitalWrite(LED , LOW); // HIGH LED desligado
  11. }
  12. //----------------------------------------------
  13. void loop()
  14. {
  15. Valor = analogRead(Entrada);
  16. if (Valor > 1000)
  17. {
  18. for (int i = 0; i <3; i++)
  19. {
  20. digitalWrite(LED, HIGH);
  21. delay(300);
  22. digitalWrite(LED, LOW);
  23. delay(300);
  24. }
  25. delay(178200);
  26. // delay(2000); // Valor para teste
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement