forked from philipellisis/arduino-virtual-pinball-board
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlunger.h
35 lines (29 loc) · 855 Bytes
/
Plunger.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
#ifndef PLUNGER_H
#define PLUNGER_H
#include <Arduino.h>
#include "HID-Project.h"
#include "Config.h"
class Plunger {
public:
Plunger();
void init();
void plungerRead();
void sendPlungerState();
void resetPlunger();
private:
bool plungerReleased = false;
bool DEBUG = false;
float plungerScaleFactor;
int adjustedValue;
unsigned char buttonState;
unsigned char buttonState2;
long priorValue = 0;
long truePriorValue = 0;
//unsigned char plungerMinSendCount = 0;
int plungerData[50] = {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};
// unsigned char incrementor = 0;
signed char plungerDataCounter = 0;
signed char getDelayedPlungerValue(signed char sensorValue);
signed char currentPlungerMax = 0;
};
#endif