forked from philipellisis/arduino-virtual-pinball-board
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommunication.h
45 lines (38 loc) · 1.24 KB
/
Communication.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
#ifndef COMMUNICATION_H
#define COMMUNICATION_H
#include <Arduino.h>
#include "Plunger.h"
#include "Buttons.h"
#include "Accelerometer.h"
#include "Config.h"
#include "Outputs.h"
class Communication {
public:
Communication();
void init(Plunger* plunger, Accelerometer* accel, Buttons* buttons, Config* config, Outputs* outputs, Joystick_* joystick);
//void init();
void communicate();
private:
bool DEBUG = false;
char* connectedString = "DEBUG,CSD Board Connected\r\n";
byte firstNumber = 0; //0 normally
byte bankOffset = 200; //200 normally
byte adminNumber = 250; //250 normally
byte connectionNumber = 251;//251 normally
byte outputSingleNumber = 252;//252 normally
byte outputButtonNumber = 253;//252 normally
byte maxNumber = 255; //255 normally
Accelerometer* _accelerometer;
Plunger* _plunger;
Buttons* _buttons;
Config* _config;
Outputs* _outputs;
Joystick_* _joystick;
byte incomingData[10];
int dataLocation = 0;
void updateOutputs();
int admin = 0;
void sendAdmin();
byte previousDOFValues[63] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
};
#endif