Gyro

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)

Accelerometer

Returns an analog value between 0 and 4095. Each Accelerometer Sensor has 3 cables, X, Y, and Z. The ports you attach them to don't have to be in any particular order (however you WILL need to use 3 ports).

Digital Sensors

There are 6 main types of Analog Sensors for the VEX CORTEX:

Touch

Returns a digital value. "1" means a closed circuit and "0" means an open circuit.

code

Sonar

Returns an analog value in centimeters (i.e. a value of 20 means 20 centimeters away), millimeters, inches, or raw data. A value of "-1" means the sensor does not receive a "reflection". The sonar sensor requires the "Input" wire to be attached the digital port directly following the main port of the Sonar Sensor (i.e. dgtl4 and dgtl5, ROBOTC will automatically fill the following port with the correct information).

code

Quadrature Encoder

A digital sensor that returns a counter value keeping track of how many "counts" the encoder has seen. This sensor will increment when traveling in the forward of direction and decrement when traveling in the reverse direction.The Quadrature Encoder requires one of the input wires be attached the interrupt port "int3" through "int6" to function properly.

code

Digital In

File:Vex dig in.png
This will make the sensor port act as just a digital input, very similar to a touch sensor.

code

Digital Out

File:Vex dig out.png
This will cause the sensor port to send out a digital high ("1") signal. Useful for using the controller to power 5V devices.