Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
vexsensor.h
Go to the documentation of this file.
1
/*-----------------------------------------------------------------------------*/
2
/* */
3
/* Copyright (c) James Pearman */
4
/* 2013 */
5
/* All Rights Reserved */
6
/* */
7
/*-----------------------------------------------------------------------------*/
8
/* */
9
/* Module: vexsensor.h */
10
/* Author: James Pearman */
11
/* Created: 7 May 2013 */
12
/* */
13
/* Revisions: */
14
/* V1.00 4 July 2013 - Initial release */
15
/* */
16
/*-----------------------------------------------------------------------------*/
17
/* */
18
/* This file is part of ConVEX. */
19
/* */
20
/* The author is supplying this software for use with the VEX cortex */
21
/* control system. ConVEX is free software; you can redistribute it */
22
/* and/or modify it under the terms of the GNU General Public License */
23
/* as published by the Free Software Foundation; either version 3 of */
24
/* the License, or (at your option) any later version. */
25
/* */
26
/* ConVEX is distributed in the hope that it will be useful, */
27
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
28
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
29
/* GNU General Public License for more details. */
30
/* */
31
/* You should have received a copy of the GNU General Public License */
32
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
33
/* */
34
/* A special exception to the GPL can be applied should you wish to */
35
/* distribute a combined work that includes ConVEX, without being obliged */
36
/* to provide the source code for any proprietary components. */
37
/* See the file exception.txt for full details of how and when the */
38
/* exception can be applied. */
39
/* */
40
/* The author can be contacted on the vex forums as jpearman */
41
/* or electronic mail using jbpearman_at_mac_dot_com */
42
/* Mentor for team 8888 RoboLancers, Pasadena CA. */
43
/* */
44
/*-----------------------------------------------------------------------------*/
45
46
#ifndef __VEXSENSOR__
47
#define __VEXSENSOR__
48
49
/*-----------------------------------------------------------------------------*/
50
/** @file vexsensor.h
51
* @brief ROBOTC style sensor interface macros and prototypes
52
*/
/*---------------------------------------------------------------------------*/
53
54
/*-----------------------------------------------------------------------------*/
55
/** @brief sensor types for vexSensorValue */
56
/** @note A ROBOTC style sensor interface to make porting code easier */
57
/*-----------------------------------------------------------------------------*/
58
59
typedef
enum
60
{
61
kVexSensorUndefined
= -1,
62
//
63
// Analog I/O Ports: light, line follower, gyro, accelerometer,
64
//
65
kVexSensorAnalog_1
= 0,
66
kVexSensorAnalog_2
= 1,
67
kVexSensorAnalog_3
= 2,
68
kVexSensorAnalog_4
= 3,
69
kVexSensorAnalog_5
= 4,
70
kVexSensorAnalog_6
= 5,
71
kVexSensorAnalog_7
= 6,
72
kVexSensorAnalog_8
= 7,
73
74
//
75
// Digital I/O Ports: Touch sensors, sonar, etc
76
//
77
kVexSensorDigital_1
= 8,
78
kVexSensorDigital_2
= 9,
79
kVexSensorDigital_3
= 10,
80
kVexSensorDigital_4
= 11,
81
kVexSensorDigital_5
= 12,
82
kVexSensorDigital_6
= 13,
83
kVexSensorDigital_7
= 14,
84
kVexSensorDigital_8
= 15,
85
kVexSensorDigital_9
= 16,
86
kVexSensorDigital_10
= 17,
87
kVexSensorDigital_11
= 18,
88
kVexSensorDigital_12
= 19,
89
90
//
91
// IMEs
92
kVexSensorIme_1
= 20,
93
kVexSensorIme_2
= 21,
94
kVexSensorIme_3
= 22,
95
kVexSensorIme_4
= 23,
96
kVexSensorIme_5
= 24,
97
kVexSensorIme_6
= 25,
98
kVexSensorIme_7
= 26,
99
kVexSensorIme_8
= 27
100
}
tVexSensors
;
101
102
#ifdef __cplusplus
103
extern
"C"
{
104
#endif
105
106
bool_t
vexSensorIsAnalog
(
tVexSensors
sensor );
107
int32_t
vexSensorValueGet
(
tVexSensors
sensor );
108
void
vexSensorValueSet
(
tVexSensors
sensor, int32_t value );
109
110
#ifdef __cplusplus
111
}
112
#endif
113
114
#endif // __VEXSENSOR__
convex
cortex
fw
vexsensor.h
Generated on Sun Jan 5 2014 15:43:37 for Convex by
1.8.4