Giter VIP home page Giter VIP logo

touchbutton's Introduction

TouchButton

Esp32 library for touch pins, detect click, release, hold press and number of taps. Biblioteca Esp32 para pines táctiles, detecta clic, soltar, mantener presionado y numero de toques

English

How to use the library?

  1. We connect the library #include "tb.h"
  2. Button initialization in one of the following ways: tb button1(pin); tb button1(pin, threshold); threshold - is a tolerance value for readings touchs
  3. It is necessary that information about clicks is always update, so we throw button1.update(); in void loop()
  4. Library functions:

button1.isClicks(count) - true if clicks is equal to count value you can single(1) double(2), three or more clicks depend of count value , otherwise false

button1.isHold() - true if the button is held down and more time has elapsed since the start of holding it than with a normal click, otherwise false

button1.isHolded() - the same as isHold(), but with one hold it returns true only once

button1.isRelease() - returns true only after release touch pin

button1.getTaps() - returns the number of clicked taps

Spanish

¿Cómo usar la biblioteca?

  1. Incluimos la biblioteca #include "tb.h"
  2. Inicialización del botón de una de las siguientes maneras: tb button1 (pin); tb button1(pin, umbral); umbral - es un valor de tolerancia para lecturas táctiles
  3. Es necesario que la información sobre clics esté siempre actualizada, por lo que lanzamos button1.update(); en void loop()
  4. Funciones de la biblioteca:

button1.isClicks(count) - verdadero si los clics son iguales al valor de conteo, click(1) dobleclick(2), tres o más clics dependen del valor de conteo, de lo contrario falso

button1.isHold() - verdadero si el botón se mantiene presionado y ha transcurrido más tiempo desde que se mantuvo presionado que con un clic normal; de lo contrario, falso

button1.isHolded() - lo mismo que isHold(), pero con una pulsación devuelve verdadero solo una vez

button1.isRelease() - devuelve verdadero solo después de soltar el pin táctil

button1.getTaps() - devuelve el número de toques en los que se hizo clic

touchbutton's People

Contributors

habuenav avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.