Vous êtes sur la page 1sur 2

W:\_ME218bTeams\DoYouEvenStateMachine_Team17\ME218B\Final Project\CODE\Headers\PoundDefines.

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
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

Page 1

/****************************************************************************
Header File
PoundDefines.h
Author
Anne Alter

Date
2/14/16
****************************************************************************/

#ifndef PoundDefines_H
#define PoundDefines_H

//FRAMWORK INCLUDES
#include "ES_Types.h"
#include "ES_Configure.h"

//INITIALIZE SERVICE
#define ALL_BITS (0xff <<2)
//PWM CONSTANTS
#define BitsPerNibble 4
#define PWMTicksPerMS 1250
#define TicksPerMS 40000
#define PeriodInMS 5
#define ServoPeriodInMs 20
//MOTOR
#define
#define
#define
#define
//MOTOR
#define
#define
#define
#define

SELECTION
LEFT_MOTOR 1
RIGHT_MOTOR 2
LEFT_WHEEL 1
RIGHT_WHEEL 2

DIRECTION
FORWARD true
BACKWARD false
LEFT_MOTOR_DIRECTION GPIO_PIN_0
RIGHT_MOTOR_DIRECTION GPIO_PIN_1

//DUTY CYCLES
#define OFF_DUTY 1
#define FORWARD_OFF 1
#define BACKWARD_OFF 99
#define HALF 50
#define FORWARD_FULLDUTY 40
#define FORWARD_HALFDUTY 20
#define BACKWARD_FULLDUTY 60
#define BACKWARD_HALFDUTY 80
#define MOTOR_ONE_BEACON 45
#define MOTOR_TWO_BEACON 55
#define ROTATION_TIME_180 1250
#define REVERSE_TIME 800
//BUMPERS
#define FRONT_BUMPER BIT6HI
#define LEFT_BUMPER BIT5HI
#define RIGHT_BUMPER BIT7HI
#define DEBOUNCE_TIME 50
//ANALOG
#define HOW_MANY 2
#define PE0 0
#define PE1 1
#define AD_TIMER_LENGTH 2

//PID control
#define pGain .032 //was 0.025
#define iGain 0.070 //was 0.1
#define dGain 0
#define DEFAULT_DUTY_CYCLE 36 //was 35
#define DEFAULT_DUTY_CYCLE_LEFT 35

W:\_ME218bTeams\DoYouEvenStateMachine_Team17\ME218B\Final Project\CODE\Headers\PoundDefines.h
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
139
140
141
142
143

Page 2

#define DEFAULT_DUTY_CYCLE_RIGHT 37
#define WIRE_SENSE_INTERRUPT 2
//PAC Defines
#define STATUS_BYTE 0xC0
#define QUERY_BYTE 0x70
#define OUR_VOTE_RED 0x80
#define OUR_VOTE_BLUE 0xB0
#define ACK BIT0HI
#define DETECT_TIME 10
#define GAME_STATUS 200

//SSI (from the TIVA's perspective)


#define SDI BIT5HI
#define SDO BIT4HI
#define SCK BIT2HI
#define SS BIT3HI
#define CPSDVSR 0x40
#define SCR 0x20 << 8

//HALL EFFECT
#define HALL_EFFECT GPIO_PIN_4
#define HALL_EFFECT_DEBOUNCE_TIME 50
#define HALL_EFFECT_DELAY_TIME 1500
//ORIENT TO TRAIL
#define ORIENT_TIME 1000
#define CITY_TIME 3000

//ATTACK
#define LOCATION_BIT 0x0F
#define BILLINGS 0x03
#define MIAMI 0x07
#define DALLAS 0x05
#define RED_ATTACK_BUCKET 690
#define BLUE_ATTACK_BUCKET 800
#define ATTACK_ERROR 40
#define COLOR GPIO_PIN_4 //RED = HI, BLUE = LOW; PORT E, PIN 4
#define FORWARD_TIME 1400
#define WAITING_BETWEEN_SHOTS 3000
#define ATTACK_TIMEOUT 20000
#define ATTACK_REVERSE_TIME 500
#define ATTACK_ROTATION_TIME 1000
//BEACON
#define BEACON_TIME 1
#define BEACON_SMOOTHING_SAMPLES 10
#define RED_BEACON_SAMPLES 12
#define BLUE_BEACON_SAMPLES 15

//FLYWHEEL
#define SMOOTHING_SAMPLES 5
#define LAUNCH_TIME 2
#define MAX_FLYWHEEL_DUTY 50
#define RED_DUTY_CYCLE 57 //14; we are blue; shooting from billings
#define BLUE_DUTY_CYCLE 47 //14; we are red; shooting from miami
#define DISPENSE_ANGLE 92
#define RESET_ANGLE 122
#define DELAY_TIME 1000
#define TICKS_PER_REV 8
//GAME STATUS
#define GAME_ON GPIO_PIN_2
#define RED GPIO_PIN_3
#define BLUE GPIO_PIN_4
#define GAME_TIME 46500

#endif /* PoundDefines_H */

Vous aimerez peut-être aussi