Closed AlexanderBrevig closed 11 years ago
Thanks to: Vytautas Janušonis
Reproduce errors using:
Button button = Button(2,PULLUP);
int counter = 0;
void setup() { pinMode(13, OUTPUT); //debug to led 13 Serial.begin(9600); }
void loop() { if(button.uniquePress()) // kitos galimos funkcijos: | isPressed() | wasPressed() | stateChanged() { counter++; Serial.print("On\n"); Serial.println(counter); digitalWrite(13,HIGH); } }
I guess we should add some debounce time constant as to prevent a high frequency registration of presses.
Thanks to: Vytautas Janušonis
Reproduce errors using:
include
Button button = Button(2,PULLUP);
int counter = 0;
void setup() { pinMode(13, OUTPUT); //debug to led 13 Serial.begin(9600); }
void loop() { if(button.uniquePress()) // kitos galimos funkcijos: | isPressed() | wasPressed() | stateChanged() { counter++; Serial.print("On\n"); Serial.println(counter); digitalWrite(13,HIGH); } }
I guess we should add some debounce time constant as to prevent a high frequency registration of presses.