9. Single Double Click and Long Press Detection

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 
 

 

 

 

Code

/*Paste your code here*/

 

int pushButton = 2;

int LED = 7;


 

void setup() {

  pinMode(pushButton, INPUT_PULLUP);

  pinMode(LED, OUTPUT);

}


 

void loop() {

  int buttonState = digitalRead(pushButton);

  digitalWrite(LED, !buttonState);

  delay(1);

}

 

Output

Video

Add a video of the output (know more)

 

 

 

 

Was this helpful?
Upvote
Downvote