#include <Bounce2.h>
#define green 2
#define red 3
int num = 0;
Bounce2::Button tipka1, tipka2 = Bounce2::Button();
void setup() {
Serial.begin(115200);
tipka1.attach(red, INPUT_PULLUP);
tipka2.attach(green, INPUT_PULLUP);
tipka1.interval(10);
tipka2.interval(10);
tipka1.setPressedState(LOW);
tipka2.setPressedState(LOW);
}
void loop() {
tipka1.update();
tipka2.update();
if(tipka1.pressed()){
num++;
Serial.println(num);
}
if(tipka2.pressed()){
num--;
Serial.println(num);
}
}