Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define botao1 11 // Port para o botao
- #define LED 10 // Port para o LED
- byte debouc = 2; // Valor de delay para debouncing
- //---------------------------
- void setup()
- {
- pinMode(LED, OUTPUT);
- pinMode(botao1, INPUT_PULLUP);
- }
- //-------------------------
- void loop()
- {
- while (digitalRead(botao1) == LOW) // Se o botao estiver apertado
- {
- delay(debouc);
- while (digitalRead(botao1) == LOW) // Se o botao continua apertado
- {
- delay(debouc);
- if (digitalRead(botao1) == HIGH) // Se o botïao foi liberado
- {
- digitalWrite(LED, HIGH); // Acende LED
- delay(600000;
- digitalWrite(LED, LOW); // Apaga LED
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement