forked from becauseinterwebs/tktalkie-v4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ControlButton.h
51 lines (44 loc) · 1 KB
/
ControlButton.h
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
51
/*
ControlButton.h - Library for TK-Talkie Control Buttons.
B. Williams Oct 30, 2017
*/
#ifndef ControlButton_h
#define ControlButton_h
#include "Arduino.h"
#include "Bounce2.h"
#include "VirtualButton.h"
//const byte CB_SOUND = 0;
//const byte CB_PTT = 1;
class ControlButton
{
public:
ControlButton();
ControlButton(byte buttonPin);
ControlButton(byte buttonPin, byte interval);
byte check();
void update();
void setPin(byte buttonPin);
byte getPin();
void setType(byte buttonType);
byte read();
byte getType();
void setInterval(byte intv);
byte getInterval();
void setup(byte buttonPin);
boolean rose();
boolean fell();
void setPTT(boolean val);
boolean isPTT();
void reset();
VirtualButton buttons[2] = { VirtualButton(), VirtualButton() };
private:
byte _pin = 0;
Bounce _button;
byte _interval = 15;
byte _value;
byte _type;
char _sound[12];
boolean _isPTT = false;
void setup();
};
#endif