-
Notifications
You must be signed in to change notification settings - Fork 0
/
_7_devices_mechs.ino
139 lines (121 loc) · 4.32 KB
/
_7_devices_mechs.ino
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// ####################################################################################################
// # Flight 3000 written by Mark Sunnucks (Snux) Copyright 2016 #
// # #
// # Based on and expanded from example code supplied with the myPinballs Custom Controller Boardset #
// # #
// # This code will not compile or run on its own. It requires the myPinballs Custom Controller #
// # Boardset hardware and frameworks, which are available here: #
// # http://mypinballs.co.uk/electronics/store.jsp #
// # #
// # Boardset, All Frameworks & Code Structure/Design are Copyright Orange Cloud Software Ltd #
// ####################################################################################################
//
// This file is part of Flight 3000.
//
// Flight 3000 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// Flight 3000 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// ___ _ __ __ _ _ _ _ _
// / __|___ _ _ ___ _ _(_)__ | \/ |___ __| |_ | || |__ _ _ _ __| | |___ _ _
// | (_ / -_) ' \/ -_) '_| / _| | |\/| / -_) _| ' \ | __ / _` | ' \/ _` | / -_) '_|
// \___\___|_||_\___|_| |_\__| |_| |_\___\__|_||_| |_||_\__,_|_||_\__,_|_\___|_|
//
//----------------------------------------
//define includes
//----------------------------------------
//----------------------------------------
//----------------------------------------
//define global variables
//----------------------------------------
//scoring setup
const int sling_hit = 10;
const int spinner_hit = 1000;
const int exit_lane_score = 25000;
//----------------------------------------
//methods
//----------------------------------------
void left_flipper()
{
//Serial.println(F("Left Flipper"));
//rotate_blastoff_left();
if (test_active)
test_left();
else
left_flipper_coil.enable();
}
void left_flipper_cancel()
{
//Serial.println(F("Left Flipper Cancel"));
left_flipper_coil.cancel();
}
void right_flipper()
{
//Serial.println(F("Right Flipper"));
//rotate_blastoff_right();
//Serial.print(F("Free Ram:"));
//Serial.println(freeRam());
if (test_active)
test_right();
else
right_flipper_coil.enable();
}
void right_flipper_cancel()
{
//Serial.println(F("Right Flipper Cancel"));
right_flipper_coil.cancel();
}
void general_points()
{
update_score(active_player_id, 100);
sound_channel1.play(6);
}
void left_top_sling()
{
if (game_started)
{
update_score(active_player_id, sling_hit);
toggle_right_bank();
top_left_slingshot_coil.pulse(25);
sound_channel1.play(3);
}
}
void right_top_sling()
{
if (game_started)
{
update_score(active_player_id, sling_hit);
toggle_right_bank();
top_right_slingshot_coil.pulse(25);
sound_channel1.play(3);
}
}
void left_bottom_sling()
{
if (game_started)
{
update_score(active_player_id, sling_hit);
toggle_right_bank();
bottom_left_slingshot_coil.pulse(25);
sound_channel1.play(3);
}
}
void right_bottom_sling()
{
if (game_started)
{
update_score(active_player_id, sling_hit);
toggle_right_bank();
bottom_right_slingshot_coil.pulse(25);
sound_channel1.play(3);
}
}
void outlane()
{
// Increment bonus
bonus_inc();
spot_lit_target();
update_score(active_player_id, exit_lane_score);
sound_channel1.play(5);
}