VEX2 Sensors Overview
(→Gyro) |
|||
| Line 158: | Line 158: | ||
<br /> | <br /> | ||
As the Gyro is turned, the values it returns are in '''tenths of degrees''', positive and negative. Thus, a SensorValue of 3600 equals 360 degrees, or one full rotation. When the sensor is mounted horizontally, counter-clockwise movements will return values from 0 to -3600; clockwise movements will return values from 0 to 3600. Once the gyro completes one full revolution, the sensor value will “roll-over” to 0 by default (for example: …3597, 3598, 3599, 3600, 0, 1, 2, 3,…). To change the “roll-over” point, un-comment line 33 (from the code below) and change the value of “SensorFullCount” from 3600 to the desired value (7200, 18000, ect) | As the Gyro is turned, the values it returns are in '''tenths of degrees''', positive and negative. Thus, a SensorValue of 3600 equals 360 degrees, or one full rotation. When the sensor is mounted horizontally, counter-clockwise movements will return values from 0 to -3600; clockwise movements will return values from 0 to 3600. Once the gyro completes one full revolution, the sensor value will “roll-over” to 0 by default (for example: …3597, 3598, 3599, 3600, 0, 1, 2, 3,…). To change the “roll-over” point, un-comment line 33 (from the code below) and change the value of “SensorFullCount” from 3600 to the desired value (7200, 18000, ect) | ||
| + | |||
| + | ''For more information on the Gyro sensor, check out the ROBOTC blog post: [http://www.robotc.net/blog/2011/10/13/programming-the-vex-gyro-in-robotc/ Programming the VEX Gyro in ROBOTC].'' | ||
<br /> | <br /> | ||
Revision as of 12:19, 15 February 2012
|
Main >> CORTEX >> Sensors Overview |
| For ROBOTC CORTEX Sensor functions, check out the CORTEX Sensor Functions page! |
|
The VEX 2.0 Cortex is equipped with 20 sensor ports. There are 8 Analog Sensor Ports and 12 Digital Sensor Ports. Note that unlike the VEX - PIC microcontroller, all Analog sensors must be in Analog ports, while all Digital sensors must be in Digital ports. There are a variety of functions and variables used for configuring these ports and accessing their values. Configuring sensors can be complicated. ROBOTC has a built-in wizard that can be used to configure the VEX 2.0 Cortex sensors. The wizard contains a number of PC windows that allow you to set the following fields for the sensor:
|
|
Analog Sensors
| There are 5 main types of Analog Sensors for the VEX CORTEX: | |
Light
| |
Potentiometer
| |
Line Follower
| |
Gyro
For more information on the Gyro sensor, check out the ROBOTC blog post: Programming the VEX Gyro in ROBOTC.
| |
Accelerometer
| |




