ENERGEN
Published

How to use oneButton Library

Hey Guys, In this tutorial I'm going to show you How to use the one-button library in an easy way.

BeginnerFull instructions provided2,746
How to use oneButton Library

Things used in this project

Story

Read more

Code

OneButton library Tutorial

Arduino
#include "OneButton.h"


OneButton Button1(A1, true);


void setup() {
  // put your setup code here, to run once:
pinMode (13,OUTPUT);

Button1.attachClick(click1);
Button1.attachDoubleClick(click2);
Button1.attachDuringLongPress(click3);
}

void loop() {
  // put your main code here, to run repeatedly:
Button1.tick();
delay(10);

}

void click1() {
digitalWrite(13,LOW);
}

void click2() {
digitalWrite(13, HIGH);  
}

Credits

ENERGEN

ENERGEN

17 projects • 10 followers
Youtube creator

Comments