View difference between Paste ID: Tw3djqP1 and V3tHzGKX
SHOW: | | - or go back to the newest paste.
1
 if (reading != lastButtonState) {
2
    // reset the debouncing timer
3
    lastDebounceTime = millis();
4
  }
5
    ///Millis é o contador atual do MCU
6
  if ((millis() - lastDebounceTime) > debounceDelay) {
7
    // whatever the reading is at, it's been there for longer
8
    // than the debounce delay, so take it as the actual current state:
9
10
    // if the button state has changed:
11
    if (reading != buttonState) {
12
      buttonState = reading;
13
14
      // only toggle the LED if the new button state is HIGH
15
      if (buttonState == HIGH) {
16
        ledState = !ledState;
17
      }
18
    }
19
  }
20
  
21
22
======================
23
 if (input (BOTAO_INCREMENTO)) //apertou o botão
24
{
25
	delay_ms(100);   
26
	 if (input (BOTAO_INCREMENTO)) // 100ms depois ainda estava apertando
27
        	       {
28
               		x++;          //então incrementa
29
	               }
30
}