VEX V5 C++ API
Namespaces | Classes | Enumerations | Functions | Variables
vex Namespace Reference

device class More...

Namespaces

 this_thread
 

Classes

class  __tridevice
 Use this class to get access to Three Wire Port functions and members. More...
 
class  accelerometer
 Use this class when programming with an accelerometer sensor. More...
 
class  analog_in
 Use this class when programming with an analog-in device. More...
 
class  bitmap
 Bitmap image. More...
 
class  brain
 Use the brain class to see battery information, SD card information, or write to the Screen. More...
 
class  bumper
 Use this class when programming with the bumper device. More...
 
class  color
 Use the color class to create Color objects. More...
 
class  competition
 Use this class to set up your program for competitions. More...
 
class  controller
 Use the controller class to get values from the remote controller as well as write to the controller's screen. More...
 
class  device
 Use the device class to get information about a vex device plugged into the V5. More...
 
class  devices
 Use the device class to get information about all of the vex devices plugged into the V5. More...
 
class  digital_in
 Use this class when programming with a digital-in device. More...
 
class  digital_out
 Use this class when programming with a digital-out device. More...
 
class  distance
 Use the distance class to control the distance sensor. More...
 
class  drivetrain
 
class  encoder
 Use this class when programming with an encoder. More...
 
class  guido
 
class  gyro
 Use this class when programming with a gyro sensor. More...
 
class  inertial
 Use the inertial class to control the inertial sensor. More...
 
class  led
 Use this class when programming with a led device. More...
 
class  light
 Use this class when programming with a light sensor. More...
 
class  limit
 Use this class when programming with the limit switch. More...
 
class  line
 Use this class when programming with a line follower. More...
 
class  motor
 Use the motor class to control motor devices. More...
 
class  motor29
 Use this class when programming a motor connected to a motor controller 29. More...
 
class  motor_group
 
class  motor_victor
 Use this class when programming with a motor connected to a victor motor controller. More...
 
class  mutex
 Use this class to create and control mutexes. More...
 
class  optical
 Use the optical class to control the optical sensor. More...
 
class  pneumatics
 Use this class when programming with a pneumatics device. More...
 
class  pot
 Use this class when programming with a potentiometer. More...
 
class  pwm_out
 Use this class when programming with a pwm-out device. More...
 
class  rotation
 Use the rotation class to control absolute encoder devices. More...
 
class  safearray
 
class  servo
 Use this class when programming with a servo device. More...
 
class  smartdrive
 
class  sonar
 Use this class when programming with a sonar sensor. More...
 
class  thread
 Use this class to create and control threads. More...
 
class  timer
 Use the timer class to create timers for your program. More...
 
class  triport
 Use this class to get and set information about devices on 3-wire ports. More...
 
class  vision
 Use this class when programming the vision sensor. More...
 

Enumerations

enum  turnType { turnType::left = 0, turnType::right = 1, turnType::undefined = 0xFF }
 
enum  percentUnits { percentUnits::pct = 0 }
 The measurement units for percentage values. More...
 
enum  timeUnits { timeUnits::sec, timeUnits::msec }
 The measurement units for time values. More...
 
enum  currentUnits { currentUnits::amp }
 The measurement units for current values. More...
 
enum  voltageUnits { voltageUnits::volt, voltageUnits::mV }
 The measurement units for voltage values. More...
 
enum  powerUnits { powerUnits::watt }
 The measurement units for power values. More...
 
enum  torqueUnits { torqueUnits::Nm, torqueUnits::InLb }
 The measurement units for torque values. More...
 
enum  rotationUnits { rotationUnits::deg, rotationUnits::rev, rotationUnits::raw = 99 }
 The measurement units for rotation values. More...
 
enum  velocityUnits { velocityUnits::pct = (int)percentUnits::pct, velocityUnits::rpm, velocityUnits::dps }
 The measurement units for velocity values. More...
 
enum  distanceUnits { distanceUnits::mm, distanceUnits::in, distanceUnits::cm }
 The measurement units for distance values. More...
 
enum  analogUnits {
  analogUnits::pct = (int)percentUnits::pct, analogUnits::range8bit, analogUnits::range10bit, analogUnits::range12bit,
  analogUnits::mV
}
 The measurement units for analog values. More...
 
enum  temperatureUnits { temperatureUnits::celsius, temperatureUnits::fahrenheit, temperatureUnits::pct = 0xFF }
 The measurement units for temperature values. More...
 
enum  directionType { directionType::fwd = 0, directionType::rev, directionType::undefined }
 The defined units for direction values. More...
 
enum  brakeType { brakeType::coast = kV5MotorBrakeModeCoast, brakeType::brake = kV5MotorBrakeModeBrake, brakeType::hold = kV5MotorBrakeModeHold, brakeType::undefined }
 The defined units for brake values. More...
 
enum  gearSetting { gearSetting::ratio36_1 = kMotorGearSet_36, gearSetting::ratio18_1 = kMotorGearSet_18, gearSetting::ratio6_1 = kMotorGearSet_06 }
 The defined units for gear values. More...
 
enum  fontType {
  fontType::mono20 = 0, fontType::mono30, fontType::mono40, fontType::mono60,
  fontType::prop20, fontType::prop30, fontType::prop40, fontType::prop60,
  fontType::mono15, fontType::mono12, fontType::chinese16 = 0xf0
}
 The defined units for font values. More...
 
enum  triportType {
  triportType::analogInput, triportType::analogOutput, triportType::digitalInput, triportType::digitalOutput,
  triportType::button, triportType::potentiometer, triportType::lineSensor, triportType::lightSensor,
  triportType::gyro, triportType::accelerometer, triportType::motor, triportType::servo,
  triportType::quadEncoder, triportType::sonar, triportType::motorS
}
 The defined units for triport devices. More...
 
enum  controllerType { controllerType::primary = kControllerMaster, controllerType::partner = kControllerPartner }
 The defined units for controller devices. More...
 
enum  axisType { axisType::xaxis, axisType::yaxis, axisType::zaxis }
 The defined units for inertial sensor axis. More...
 
enum  orientationType { orientationType::roll, orientationType::pitch, orientationType::yaw }
 The defined units for inertial sensor orientation. More...
 
enum  sizeType { sizeType::none, sizeType::small, sizeType::medium, sizeType::large }
 The defined units for distance sensor object size. More...
 
enum  ledState { ledState::off, ledState::on }
 The defined units for optical sensor led state. More...
 

Functions

void wait (double time, timeUnits units=timeUnits::sec)
 Wait for a specific amount of time. Identical to sleep() More...
 
void sleep (double duration, timeUnits units=timeUnits::sec)
 Wait for a specific amount of time. Identical to wait() More...
 
void sleepMs (uint32_t duration)
 Wait for a specific amount of time (in milliseconds) More...
 
double clock ()
 System time, in seconds. More...
 
uint32_t clockMs ()
 System time, in milliseconds. More...
 
uint64_t clockUs ()
 System time, in microseconds. More...
 

Variables

const rotationUnits degrees
 
const rotationUnits turns
 
const percentUnits percent
 
const timeUnits seconds
 
const distanceUnits inches
 
const distanceUnits mm
 
const directionType forward
 
const directionType reverse
 
const turnType left
 
const turnType right
 
const axisType xaxis
 
const axisType yaxis
 
const axisType zaxis
 
const orientationType roll
 
const orientationType pitch
 
const orientationType yaw
 
const fontType monoM
 
const fontType monoL
 
const fontType monoXL
 
const fontType monoXXL
 
const fontType monoS
 
const fontType monoXS
 
const fontType propM
 
const fontType propL
 
const fontType propXL
 
const fontType propXXL
 
const controllerType primary
 
const controllerType partner
 
const char * rumbleLong
 
const char * rumbleShort
 
const char * rumblePulse
 
const int32_t PORT1
 
const int32_t PORT2
 
const int32_t PORT3
 
const int32_t PORT4
 
const int32_t PORT5
 
const int32_t PORT6
 
const int32_t PORT7
 
const int32_t PORT8
 
const int32_t PORT9
 
const int32_t PORT10
 
const int32_t PORT11
 
const int32_t PORT12
 
const int32_t PORT13
 
const int32_t PORT14
 
const int32_t PORT15
 
const int32_t PORT16
 
const int32_t PORT17
 
const int32_t PORT18
 
const int32_t PORT19
 
const int32_t PORT20
 
const int32_t PORT21
 
const int32_t PORT22
 
const percentUnits pct
 
const timeUnits sec
 
const timeUnits msec
 
const voltageUnits volt
 
const currentUnits amp
 
const powerUnits watt
 
const torqueUnits Nm
 
const torqueUnits InLb
 
const rotationUnits deg
 
const rotationUnits rev
 
const velocityUnits rpm
 
const velocityUnits dps
 
const temperatureUnits celsius
 
const temperatureUnits fahrenheit
 
const directionType fwd
 
const brakeType coast
 
const brakeType brake
 
const brakeType hold
 
const gearSetting ratio36_1
 
const gearSetting ratio18_1
 
const gearSetting ratio6_1
 
const colorblack
 
const colorwhite
 
const colorred
 
const colorgreen
 
const colorblue
 
const coloryellow
 
const colororange
 
const colorpurple
 
const colorcyan
 
const colortransparent
 
const fontType mono20
 
const fontType mono30
 
const fontType mono40
 
const fontType mono60
 
const fontType mono15
 
const fontType mono12
 
const fontType prop20
 
const fontType prop30
 
const fontType prop40
 
const fontType prop60
 
const analogUnits range8bit
 
const analogUnits range10bit
 
const analogUnits range12bit
 
const analogUnits mV
 

Detailed Description

device class

Vision sensor device class.

Triport device class.

All devices class.

base interface class used with IMU and gyro

a safe array template

Enumeration Type Documentation

◆ turnType

enum vex::turnType
strong
Enumerator
left 
right 
undefined 

◆ percentUnits

enum vex::percentUnits
strong

The measurement units for percentage values.

Enumerator
pct 

A percentage unit that represents a value from 0% to 100%.

◆ timeUnits

enum vex::timeUnits
strong

The measurement units for time values.

Enumerator
sec 

A time unit that is measured in seconds.

msec 

A time unit that is measured in milliseconds.

◆ currentUnits

enum vex::currentUnits
strong

The measurement units for current values.

Enumerator
amp 

A current unit that is measured in amps.

◆ voltageUnits

enum vex::voltageUnits
strong

The measurement units for voltage values.

Enumerator
volt 

A voltage unit that is measured in volts.

mV 

The measurement units for power values millivolts.

◆ powerUnits

enum vex::powerUnits
strong

The measurement units for power values.

Enumerator
watt 

A power unit that is measured in watts.

◆ torqueUnits

enum vex::torqueUnits
strong

The measurement units for torque values.

Enumerator
Nm 

A torque unit that is measured in Newton Meters.

InLb 

A torque unit that is measured in Inch Pounds.

◆ rotationUnits

enum vex::rotationUnits
strong

The measurement units for rotation values.

Enumerator
deg 

A rotation unit that is measured in degrees.

rev 

A rotation unit that is measured in revolutions.

raw 

A rotation unit that is measured in raw data form.

◆ velocityUnits

enum vex::velocityUnits
strong

The measurement units for velocity values.

Enumerator
pct 

A velocity unit that is measured in percentage.

rpm 

A velocity unit that is measured in rotations per minute.

dps 

A velocity unit that is measured in degrees per second.

◆ distanceUnits

enum vex::distanceUnits
strong

The measurement units for distance values.

Enumerator
mm 

A distance unit that is measured in millimeters.

in 

A distance unit that is measured in inches.

cm 

A distance unit that is measured in centimeters.

◆ analogUnits

enum vex::analogUnits
strong

The measurement units for analog values.

Enumerator
pct 

An analog unit that is measured in percentage.

range8bit 

An analog unit that is measured in an 8-bit analog value (a value with 256 possible states).

range10bit 

An analog unit that is measured in a 10-bit analog value (a value with 1024 possible states).

range12bit 

An analog unit that is measured in a 12-bit analog value (a value with 4096 possible states).

mV 

An analog unit that is measured in millivolts.

◆ temperatureUnits

enum vex::temperatureUnits
strong

The measurement units for temperature values.

Enumerator
celsius 

A temperature unit that is measured in degrees Celsius.

fahrenheit 

A temperature unit that is measured in degrees Fahrenheit.

pct 

A temperature unit that is measured in percentage of allowed range.

◆ directionType

enum vex::directionType
strong

The defined units for direction values.

Enumerator
fwd 

A direction unit that is defined as forward.

rev 

A direction unit that is defined as backward.

undefined 

◆ brakeType

enum vex::brakeType
strong

The defined units for brake values.

Enumerator
coast 

A brake unit that is defined as coast.

brake 

A brake unit that is defined as brake.

hold 

A brake unit that is defined as hold.

undefined 

◆ gearSetting

enum vex::gearSetting
strong

The defined units for gear values.

Enumerator
ratio36_1 

A gear unit that is defined as the red 36:1 gear cartridge used in V5 Smart Motors.

ratio18_1 

A gear unit that is defined as the green 18:1 gear cartridge used in V5 Smart Motors.

ratio6_1 

A gear unit that is defined as the blue 6:1 gear cartridge used in V5 Smart Motors.

◆ fontType

enum vex::fontType
strong

The defined units for font values.

Enumerator
mono20 

A font unit that is defined as mono20.

mono30 

A font unit that is defined as mono30.

mono40 

A font unit that is defined as mono40.

mono60 

A font unit that is defined as mono60.

prop20 

A font unit that is defined as prop20.

prop30 

A font unit that is defined as prop30.

prop40 

A font unit that is defined as prop40.

prop60 

A font unit that is defined as prop60.

mono15 

A font unit that is defined as mono15.

mono12 

A font unit that is defined as mono12.

chinese16 

A font supporting Chinese characters.

◆ triportType

enum vex::triportType
strong

The defined units for triport devices.

Enumerator
analogInput 

A triport unit that is defined as an analog input.

analogOutput 

A triport unit that is defined as an analog output.

digitalInput 

A triport unit that is defined as a digital input.

digitalOutput 

A triport unit that is defined as a digital output.

button 

A triport unit that is defined as a button.

potentiometer 

A triport unit that is defined as a potentiometer.

lineSensor 

A triport unit that is defined as a line sensor.

lightSensor 

A triport unit that is defined as a light sensor.

gyro 

A triport unit that is defined as a gyro.

accelerometer 

A triport unit that is defined as an accelerometer.

motor 

A triport unit that is defined as a motor.

servo 

A triport unit that is defined as a servo.

quadEncoder 

A triport unit that is defined as a quadrature encoder.

sonar 

A triport unit that is defined as a sonar.

motorS 

A triport unit that is defined as a motor with slew rate control.

◆ controllerType

enum vex::controllerType
strong

The defined units for controller devices.

Enumerator
primary 

A controller unit defined as a primary controller.

partner 

A controller unit defined as a partner controller.

◆ axisType

enum vex::axisType
strong

The defined units for inertial sensor axis.

Enumerator
xaxis 
yaxis 
zaxis 

◆ orientationType

enum vex::orientationType
strong

The defined units for inertial sensor orientation.

Enumerator
roll 
pitch 
yaw 

◆ sizeType

enum vex::sizeType
strong

The defined units for distance sensor object size.

Enumerator
none 
small 
medium 
large 

◆ ledState

enum vex::ledState
strong

The defined units for optical sensor led state.

Enumerator
off 
on 

Function Documentation

◆ wait()

void vex::wait ( double  time,
timeUnits  units = timeUnits::sec 
)

Wait for a specific amount of time. Identical to sleep()

Parameters
timeThe length of time to wait
unitsThe units of time (default seconds)

◆ sleep()

void vex::sleep ( double  duration,
timeUnits  units = timeUnits::sec 
)

Wait for a specific amount of time. Identical to wait()

Parameters
durationThe length of time to wait
unitsThe units of time (default seconds)

◆ sleepMs()

void vex::sleepMs ( uint32_t  duration)

Wait for a specific amount of time (in milliseconds)

Parameters
durationThe length of time to wait (in milliseconds)

◆ clock()

double vex::clock ( )

System time, in seconds.

◆ clockMs()

uint32_t vex::clockMs ( )

System time, in milliseconds.

◆ clockUs()

uint64_t vex::clockUs ( )

System time, in microseconds.

Variable Documentation

◆ degrees

const rotationUnits vex::degrees

◆ turns

const rotationUnits vex::turns

◆ percent

const percentUnits vex::percent

◆ seconds

const timeUnits vex::seconds

◆ inches

const distanceUnits vex::inches

◆ mm

const distanceUnits vex::mm

◆ forward

const directionType vex::forward

◆ reverse

const directionType vex::reverse

◆ left

const turnType vex::left

◆ right

const turnType vex::right

◆ xaxis

const axisType vex::xaxis

◆ yaxis

const axisType vex::yaxis

◆ zaxis

const axisType vex::zaxis

◆ roll

const orientationType vex::roll

◆ pitch

const orientationType vex::pitch

◆ yaw

const orientationType vex::yaw

◆ monoM

const fontType vex::monoM

◆ monoL

const fontType vex::monoL

◆ monoXL

const fontType vex::monoXL

◆ monoXXL

const fontType vex::monoXXL

◆ monoS

const fontType vex::monoS

◆ monoXS

const fontType vex::monoXS

◆ propM

const fontType vex::propM

◆ propL

const fontType vex::propL

◆ propXL

const fontType vex::propXL

◆ propXXL

const fontType vex::propXXL

◆ primary

const controllerType vex::primary

◆ partner

const controllerType vex::partner

◆ rumbleLong

const char* vex::rumbleLong

◆ rumbleShort

const char* vex::rumbleShort

◆ rumblePulse

const char* vex::rumblePulse

◆ PORT1

const int32_t vex::PORT1

◆ PORT2

const int32_t vex::PORT2

◆ PORT3

const int32_t vex::PORT3

◆ PORT4

const int32_t vex::PORT4

◆ PORT5

const int32_t vex::PORT5

◆ PORT6

const int32_t vex::PORT6

◆ PORT7

const int32_t vex::PORT7

◆ PORT8

const int32_t vex::PORT8

◆ PORT9

const int32_t vex::PORT9

◆ PORT10

const int32_t vex::PORT10

◆ PORT11

const int32_t vex::PORT11

◆ PORT12

const int32_t vex::PORT12

◆ PORT13

const int32_t vex::PORT13

◆ PORT14

const int32_t vex::PORT14

◆ PORT15

const int32_t vex::PORT15

◆ PORT16

const int32_t vex::PORT16

◆ PORT17

const int32_t vex::PORT17

◆ PORT18

const int32_t vex::PORT18

◆ PORT19

const int32_t vex::PORT19

◆ PORT20

const int32_t vex::PORT20

◆ PORT21

const int32_t vex::PORT21

◆ PORT22

const int32_t vex::PORT22

◆ pct

const percentUnits vex::pct

◆ sec

const timeUnits vex::sec

◆ msec

const timeUnits vex::msec

◆ volt

const voltageUnits vex::volt

◆ amp

const currentUnits vex::amp

◆ watt

const powerUnits vex::watt

◆ Nm

const torqueUnits vex::Nm

◆ InLb

const torqueUnits vex::InLb

◆ deg

const rotationUnits vex::deg

◆ rev

const rotationUnits vex::rev

◆ rpm

const velocityUnits vex::rpm

◆ dps

const velocityUnits vex::dps

◆ celsius

const temperatureUnits vex::celsius

◆ fahrenheit

const temperatureUnits vex::fahrenheit

◆ fwd

const directionType vex::fwd

◆ coast

const brakeType vex::coast

◆ brake

const brakeType vex::brake

◆ hold

const brakeType vex::hold

◆ ratio36_1

const gearSetting vex::ratio36_1

◆ ratio18_1

const gearSetting vex::ratio18_1

◆ ratio6_1

const gearSetting vex::ratio6_1

◆ black

const color& vex::black

◆ white

const color& vex::white

◆ red

const color& vex::red

◆ green

const color& vex::green

◆ blue

const color& vex::blue

◆ yellow

const color& vex::yellow

◆ orange

const color& vex::orange

◆ purple

const color& vex::purple

◆ cyan

const color& vex::cyan

◆ transparent

const color& vex::transparent

◆ mono20

const fontType vex::mono20

◆ mono30

const fontType vex::mono30

◆ mono40

const fontType vex::mono40

◆ mono60

const fontType vex::mono60

◆ mono15

const fontType vex::mono15

◆ mono12

const fontType vex::mono12

◆ prop20

const fontType vex::prop20

◆ prop30

const fontType vex::prop30

◆ prop40

const fontType vex::prop40

◆ prop60

const fontType vex::prop60

◆ range8bit

const analogUnits vex::range8bit

◆ range10bit

const analogUnits vex::range10bit

◆ range12bit

const analogUnits vex::range12bit

◆ mV

const analogUnits vex::mV