-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathController.h
71 lines (67 loc) · 1.67 KB
/
Controller.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef Controller_h
#define Controller_h
#include <Arduino.h>
//***********************************************************************
class Mux
{
public:
Mux(byte outpin_, byte numPins_, bool analog_);
byte outpin;
byte numPins;
bool analog;
};
//************************************************************************
//Button (Pin Number, Command, Note Number, Channel, Debounce Time)
class Button
{
public:
Button(byte pin, byte command, byte value, byte channel, byte debounce);
Button(Mux mux, byte muxpin, byte command, byte value, byte channel, byte debounce);
byte getValue();
void muxUpdate();
void newValue(byte command, byte value, byte channel);
byte Bcommand;
byte Bvalue;
byte Bchannel;
byte Btoggle;
byte LedPin;
bool LedState = LOW;
private:
byte _previous;
byte _current;
unsigned long _time;
int _debounce;
byte _pin;
byte _muxpin;
byte _numMuxPins;
byte _value;
byte _command;
bool _busy;
byte _status;
byte _last;
byte _enablepin;
};
//*************************************************************************
class Pot
{
public:
Pot(byte pin, byte command, byte control, byte channel);
Pot(Mux mux, byte muxpin ,byte command, byte control, byte channel);
void muxUpdate();
void newValue(byte command, byte value, byte channel);
byte getValue();
byte Pcommand;
byte Pcontrol;
byte Pchannel;
private:
byte _pin;
byte _muxpin;
byte _numMuxPins;
byte _control;
int _value;
int _oldValue;
bool _changed;
byte _enablepin;
};
//*************************************************************************
#endif