bool presskey = false;
bool led = false;
int count = 0;
void setup() {
// put your setup code here, to run once:
pinMode(9, OUTPUT);
pinMode(10, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
bool key10 = !digitalRead(10);
bool key5 = !digitalRead(5);
if (key10 && !led){
led = true;
delay(50);
count = count+1;
Serial.print(count);
}
if (key5 && led){
led = false;
delay(50);
}
digitalWrite(9, led);
}