Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define botao1 11 // Port para o botao
- byte debouc = 2; // Valor de delay para debouncing
- //---------------------------
- void setup()
- {
- ;
- }
- //-------------------------
- 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
- {
- ; // aqui o code
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement