-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDirector.h
61 lines (50 loc) · 1021 Bytes
/
Director.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
/*
Director.h - Library for controlling multiple animatronic items
*/
#ifndef _ARDUINO_Director
#define _ARDUINO_Director
#include <Arduino.h>
#include <Servo.h>
class Actor {
public:
String GetName();
void SetName(String _name);
private:
String name;
};
class ActorServo : public Actor {
public:
ActorServo(String _name, int _pin);
void Start();
void Move(int deg);
private:
Servo myservo;
int pin;
};
class ActorButton : public Actor {
public:
ActorButton(String _name, int _pin);
int Read();
private:
int pin;
int state;
int reading;
unsigned long lastDebounceTime;
int lastButtonState;
};
class Director {
public:
Director();
void Assign(ActorServo *_actors, int _qty);
void Assign(ActorButton *_buttons, int _qty);
void Options();
void StartServos();
void Listen();
private:
ActorServo *actors;
ActorButton *buttons;
int servoQuantity;
int buttonQuantity;
String incoming;
};
#endif