Robotec
1.0.0
Button.h
1
/* -- Button --
2
* Parte de la biblioteca "Robotec"
3
* created 20 Dic 2023
4
* by Lucas Martin Treser
5
*/
6
7
#ifndef Button_h
8
#define Button_h
9
10
#include "Arduino.h"
11
12
/*** Constantes Globales Button ***/
13
static
const
uint8_t PULL_UP = 0;
14
static
const
uint8_t PULL_UP_INTERNAL = 2;
15
static
const
uint8_t PULL_DOWN = 3;
16
17
/*** Pulsador ***/
18
class
Button
{
19
public
:
20
Button
(uint8_t buttonPin, uint8_t buttonMode);
21
bool
push
();
22
void
pushStart
(uint16_t time);
23
void
pushStart
(
void
(*callback)());
24
25
private
:
26
uint8_t _buttonPin;
27
uint8_t _buttonMode;
28
uint8_t _buttonState;
29
uint8_t _buttonLastState;
30
uint32_t _timeLast;
31
static
const
uint32_t _TIME_DEBOUNCE = 50;
// Ajustar este valor segĂșn sea necesario
32
};
33
34
#endif
Button
Definition:
Button.h:18
Button::Button
Button(uint8_t buttonPin, uint8_t buttonMode)
Pulsador (pushbutton)
Definition:
Button.cpp:15
Button::pushStart
void pushStart(uint16_t time)
Lee el estado de un Pulsador y genera una demora bloqueante (delay) segun el tiempo especificado por ...
Definition:
Button.cpp:55
Button::push
bool push()
Lee el estado de un boton.
Definition:
Button.cpp:33
Generado por
1.9.4