-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.h
More file actions
52 lines (36 loc) · 757 Bytes
/
Copy pathButton.h
File metadata and controls
52 lines (36 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef Button_h
#define Button_h
#include <Bounce2.h>
#include "Arduino.h"
class Button {
public:
// Class Variable
// Public Attributes
// Constructors
Button();
// Destructors
~Button();
// Public functions
boolean update();
void init(byte pin);
void init(byte pin, byte led);
boolean isPressed();
boolean isJustPressed();
boolean isJustReleased();
byte getPin();
void turnLedOn();
void turnLedOff();
boolean isLedTurnedOn();
private:
// Private Attributes
byte _pin;
byte _led;
Bounce _button;
byte _previousState;
boolean _justReleased;
boolean _justPressed;
boolean _pressed;
boolean _ledOn;
// Private Functions
};
#endif