-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreditBoard.ino
More file actions
61 lines (53 loc) · 1.27 KB
/
CreditBoard.ino
File metadata and controls
61 lines (53 loc) · 1.27 KB
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
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Multi-Coin Credit Board
* Michael Saunders - August 2016
*
* Allows a single coin mechanism to coin-up games that expect separate coin triggers (TMNT, Sunset Riders, etc.)
*/
int CreditCounter;
bool CoinInserted;
bool Start1Pressed;
bool Start2Pressed;
bool Start3Pressed;
bool Start4Pressed;
void setup() {
//pinMode( 12, INPUT );
//digitalWrite( 12, HIGH );
CreditCounter = 0;
CoinInserted = false;
}
void loop() {
if (CoinInserted) {
CreditCounter+;
CoinInserted = false;
}
if (CreditCounter > 0) {
if (Start1Pressed) {
Start1Pressed = false;
CreditCounter--;
//Send pulse to game
}
if (Start2Pressed) {
Start2Pressed = false;
CreditCounter--;
//Send pulse to game
}
if (Start3Pressed) {
Start3Pressed = false;
CreditCounter--;
//Send pulse to game
}
if (Start4Pressed) {
Start4Pressed = false;
CreditCounter--;
//Send pulse to game
}
} else { //ignore button presses if we have no coins
Start1Pressed = false;
Start2Pressed = false;
Start3Pressed = false;
Start4Pressed = false;
}
}
// raise interupt upon coin insertion
// raise interupt upon start button press