-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreciever.ino
71 lines (49 loc) · 1.26 KB
/
reciever.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
#include "motor.h"
#include "submerge.h"
#include "fire.h"
#include "head.h"
#include "Arduino.h"
//each differnt section of the champ bot
//is its own class and is a global object.
Motor motorMode;
Fire fireMode;
Submerge submergingMode;
Head headRotationMode;
Master masterSetup;
void setup() {
//set the pins for each part.
//port 2 - 7
//ch 1 - 6
// ch 1 left and right on the left stick
// ch 2 oil spray
// ch 3 & 4 right analog stick
// ch 5 glowPlug / little top flipper right
// ch 6 submergin/ large left flipper
//shift register 7-10
motorMode.pins(4,5,10,6,7,A5);
fireMode.pins(3,6,5,1);
//7,8,9 input
//5,6,7,8, outputs
submergingMode.pins(7,8,9,3,2,8,4);
headRotationMode.pins(2,A3,A4);
/*
So A0 - A5 pins get mapped to values
14 - 19
*/
masterSetup.pins(A2,A1,A0);
Serial.begin(9600);
masterSetup.resetRelayes();
}
void loop() {
fireMode.checkFireSwitch();
bool submerginOrRissing = submergingMode.checkSubmerging();
motorMode.readMotorsInputAndTurn(submerging);
headRotationMode.checkHeadRotation();
/*
//masterSetup.testShiftRegister();
//masterSetup.testShiftRegister();
//masterSetup.testShiftRegister();
*/
masterSetup.cycleSwitchRelay();
delay(2000);
}