-
Notifications
You must be signed in to change notification settings - Fork 1
/
vex_units.h
237 lines (223 loc) · 8.01 KB
/
vex_units.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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
/*----------------------------------------------------------------------------*/
/* */
/* Copyright (c) Robomatter 2016, All rights reserved. */
/* */
/* Module: vex_units.h */
/* Author: James Pearman */
/* Created: 5 July 2017 */
/* */
/* Revisions: */
/* V1.00 TBD - Initial release */
/* */
/*----------------------------------------------------------------------------*/
#ifndef VCS_UNITS_H
#define VCS_UNITS_H
/*-----------------------------------------------------------------------------*/
/** @file vex_units.h
* @brief Header for global units
*//*---------------------------------------------------------------------------*/
namespace vex {
/**
@brief The measurement units for percentage values.
*/
enum class percentUnits {
/** @brief A percentage unit that represents a value from 0% to 100% */
pct = 0
};
/**
@brief The measurement units for time values.
*/
enum class timeUnits {
/** @brief A time unit that is measured in seconds.*/
sec,
/** @brief A time unit that is measured in milliseconds.*/
msec
};
/**
@brief The measurement units for current values.
*/
enum class currentUnits {
/** @brief A current unit that is measured in amps.*/
amp
};
/**
@brief The measurement units for voltage values.
*/
enum class voltageUnits {
/** @brief A voltage unit that is measured in volts.*/
volt,
/** @brief The measurement units for power values millivolts.*/
mV
};
/**
@brief The measurement units for power values.
*/
enum class powerUnits {
/** @brief A power unit that is measured in watts.*/
watt
};
/**
@brief The measurement units for torque values.
*/
enum class torqueUnits {
/** @brief A torque unit that is measured in Newton Meters.*/
Nm,
/** @brief A torque unit that is measured in Inch Pounds.*/
InLb
};
/**
@brief The measurement units for rotation values.
*/
enum class rotationUnits {
/** @brief A rotation unit that is measured in degrees.*/
deg,
/** @brief A rotation unit that is measured in revolutions.*/
rev,
/** @brief A rotation unit that is measured in raw data form.*/
raw = 99
};
/**
@brief The measurement units for velocity values.
*/
enum class velocityUnits {
/** @brief A velocity unit that is measured in percentage.*/
pct = (int)percentUnits::pct,
/** @brief A velocity unit that is measured in rotations per minute.*/
rpm,
/** @brief A velocity unit that is measured in degrees per second.*/
dps
};
/**
@brief The measurement units for distance values.
*/
enum class distanceUnits {
/** @brief A distance unit that is measured in millimeters.*/
mm,
/** @brief A distance unit that is measured in inches.*/
in,
/** @brief A distance unit that is measured in centimeters.*/
cm
};
/**
@brief The measurement units for analog values.
*/
enum class analogUnits {
/** @brief An analog unit that is measured in percentage.*/
pct = (int)percentUnits::pct,
/** @brief An analog unit that is measured in an 8-bit analog value (a value with 256 possible states).*/
range8bit,
/** @brief An analog unit that is measured in a 10-bit analog value (a value with 1024 possible states).*/
range10bit,
/** @brief An analog unit that is measured in a 12-bit analog value (a value with 4096 possible states).*/
range12bit,
/** @brief An analog unit that is measured in millivolts.*/
mV
};
// Motor related
/**
@brief The defined units for direction values.
*/
enum class directionType {
/** @brief A direction unit that is defined as forward.*/
fwd = 0,
/** @brief A direction unit that is defined as backward.*/
rev,
undefined
} ;
/**
@brief The defined units for brake values.
*/
enum class brakeType {
/** @brief A brake unit that is defined as coast.*/
coast = kV5MotorBrakeModeCoast,
/** @brief A brake unit that is defined as brake.*/
brake = kV5MotorBrakeModeBrake,
/** @brief A brake unit that is defined as hold.*/
hold = kV5MotorBrakeModeHold,
undefined
} ;
/**
@brief The defined units for gear values.
*/
enum class gearSetting {
/** @brief A gear unit that is defined as the red 36:1 gear cartridge used in V5 Smart Motors.*/
ratio36_1 = kMotorGearSet_36,
/** @brief A gear unit that is defined as the green 18:1 gear cartridge used in V5 Smart Motors.*/
ratio18_1 = kMotorGearSet_18,
/** @brief A gear unit that is defined as the blue 6:1 gear cartridge used in V5 Smart Motors.*/
ratio6_1 = kMotorGearSet_06
};
// Brain/LCD related
/**
@brief The defined units for font values.
*/
enum class fontType {
/** @brief A font unit that is defined as mono20.*/
mono20 = 0,
/** @brief A font unit that is defined as mono30.*/
mono30,
/** @brief A font unit that is defined as mono40.*/
mono40,
/** @brief A font unit that is defined as mono60.*/
mono60,
/** @brief A font unit that is defined as prop20.*/
prop20,
/** @brief A font unit that is defined as prop30.*/
prop30,
/** @brief A font unit that is defined as prop40.*/
prop40,
/** @brief A font unit that is defined as prop60.*/
prop60,
// not in spec
/** @brief A font unit that is defined as mono15.*/
mono15,
/** @brief A font unit that is defined as mono12.*/
mono12
};
// triport
/**
@brief The defined units for triport devices.
*/
enum class triportType {
/** @brief A triport unit that is defined as an analog input.*/
analogInput,
/** @brief A triport unit that is defined as an analog output.*/
analogOutput,
/** @brief A triport unit that is defined as a digital input.*/
digitalInput,
/** @brief A triport unit that is defined as a digital output.*/
digitalOutput,
/** @brief A triport unit that is defined as a button.*/
button,
/** @brief A triport unit that is defined as a potentiometer.*/
potentiometer,
/** @brief A triport unit that is defined as a line sensor.*/
lineSensor,
/** @brief A triport unit that is defined as a light sensor.*/
lightSensor,
/** @brief A triport unit that is defined as a gyro.*/
gyro,
/** @brief A triport unit that is defined as an accelerometer.*/
accelerometer,
/** @brief A triport unit that is defined as a motor.*/
motor,
/** @brief A triport unit that is defined as a servo.*/
servo,
/** @brief A triport unit that is defined as a quadrature encoder.*/
quadEncoder,
/** @brief A triport unit that is defined as a sonar.*/
sonar,
/** @brief A triport unit that is defined as a motor with slew rate control.*/
motorS,
};
/**
@brief The defined units for controller devices.
*/
enum class controllerType {
/** @brief A controller unit defined as a primary controller.*/
primary = kControllerMaster,
/** @brief A controller unit defined as a partner controller.*/
partner = kControllerPartner
};
};
#endif // VCS_UNITS_H