Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (reading != lastButtonState) {
- // reset the debouncing timer
- lastDebounceTime = millis();
- }
- ///Millis Γ© o contador atual do MCU
- if ((millis() - lastDebounceTime) > debounceDelay) {
- // whatever the reading is at, it's been there for longer
- // than the debounce delay, so take it as the actual current state:
- // if the button state has changed:
- if (reading != buttonState) {
- buttonState = reading;
- // only toggle the LED if the new button state is HIGH
- if (buttonState == HIGH) {
- ledState = !ledState;
- }
- }
- }
- ======================
- if (input (BOTAO_INCREMENTO)) //apertou o botΓ£o
- {
- delay_ms(100);
- if (input (BOTAO_INCREMENTO)) // 100ms depois ainda estava apertando
- {
- x++; //entΓ£o incrementa
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement