-
Notifications
You must be signed in to change notification settings - Fork 1
/
defines.ic
104 lines (56 loc) · 1.92 KB
/
defines.ic
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
/**
* @file defines.ic
* @brief All of the #define's used anywhere
* @author Andrew Krieger and Joel Friedly
* @date 6/2/2011
*
*/
/// Left motor port
#define MOTOR_LEFT 1
/// Right motor port
#define MOTOR_RIGHT 3
/// Standard power to run the motors at. Ended up using hard-coded numbers most places.
#define MOT_PWR 100
/// Front left optosensor port
#define OPTO_FRONT_LEFT 20
/// Front right optosensor port
#define OPTO_FRONT_RIGHT 22
/// Back left optosensor port
#define OPTO_BACK_LEFT 3
/// Back right optosensor port
#define OPTO_BACK_RIGHT 2
/// Left shaft encoder port
#define SHAFT_LEFT 7
/// Right shaft encoder port
#define SHAFT_RIGHT 12
/// Port for the side-mounted CdS cell
#define CDS_SIDE 16
/// Port for the front-mounted CdS cell
#define CDS_FRONT 18
/// Right bump switch port
#define SWITCH_WALL_RIGHT 15
/// Left bump switch port
#define SWITCH_WALL_LEFT 10
/// Back right switch port. This switch was not in the final design.
#define SWITCH_BACK_RIGHT 27
/// Corn arm servo port
#define SERVO_CORN 0
/// Hay arm servo port
#define SERVO_HAY 3
/// Empirically determined optosensor threshold. Values <100 were considered on a strip and values >100 were considered off.
#define OPTO_THRESHOLD 100
/// Empirically determined CdS cell threshold. Values <20 were considered red and values >20 were considered blue.
#define CDS_THRESHOLD 20
/// Wait for this many loops to confirm we're over something shiny (ie, aluminum strips)
#define SHINY_TIME 1
/// Returned by @ref press_button if the start button is pressed
#define BUTTON_START 0
/// Returned by @ref press_button if the stop button is pressed
#define BUTTON_STOP 1
/// Number of times to attempt to hit the RED BUTTOM
#define RED_BUTTON_TRIES 4
/// Servo angle to have with the corn arm rotated down
#define CORN_DOWN 160
/// Servo angle to have with the corn arm rotated up
#define CORN_UP 60
#use "encoders.ic"