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  drivetrain
 Use the motor class to control motor devices. More...
 
class  encoder
 Use this class when programming with an encoder. More...
 
class  gyro
 Use this class when programming with a gyro 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_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  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  safearray
 
class  servo
 Use this class when programming with a servo device. More...
 
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 }
 
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...
 

Functions

void sleep (double duration, timeUnits units=timeUnits::sec)
 
void sleepMs (uint32_t duration)
 
double clock ()
 
uint32_t clockMs ()
 System time, in milliseconds. More...
 
uint64_t clockUs ()
 System time, in microseconds. More...
 

Variables

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
 
percentUnits pct
 
timeUnits sec
 
timeUnits msec
 
currentUnits amp
 
powerUnits watt
 
torqueUnits Nm
 
torqueUnits InLb
 
rotationUnits deg
 
rotationUnits rev
 
velocityUnits rpm
 
temperatureUnits celsius
 
temperatureUnits fahrenheit
 
directionType fwd
 
brakeType coast
 
brakeType brake
 
brakeType hold
 
gearSetting ratio36_1
 
gearSetting ratio18_1
 
gearSetting ratio6_1
 
const colorblack
 
const colorwhite
 
const colorred
 
const colorgreen
 
const colorblue
 
const coloryellow
 
const colororange
 
const colorpurple
 
const colorcyan
 
const colortransparent
 
fontType mono20
 
fontType mono30
 
fontType mono40
 
fontType mono60
 
fontType mono15
 
fontType mono12
 
fontType prop20
 
fontType prop30
 
fontType prop40
 
fontType prop60
 
analogUnits range8bit
 
analogUnits range10bit
 
analogUnits range12bit
 
analogUnits mV
 

Detailed Description

device class

Vision sensor device class.

Triport device class.

All devices class.

a safe array template

Enumeration Type Documentation

◆ turnType

enum vex::turnType
strong
Enumerator
left 
right 

◆ 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.

Function Documentation

◆ sleep()

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

◆ sleepMs()

void vex::sleepMs ( uint32_t  duration)

◆ clock()

double vex::clock ( )

◆ clockMs()

uint32_t vex::clockMs ( )

System time, in milliseconds.

◆ clockUs()

uint64_t vex::clockUs ( )

System time, in microseconds.

Variable Documentation

◆ 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

percentUnits vex::pct

◆ sec

timeUnits vex::sec

◆ msec

timeUnits vex::msec

◆ amp

currentUnits vex::amp

◆ watt

powerUnits vex::watt

◆ Nm

torqueUnits vex::Nm

◆ InLb

torqueUnits vex::InLb

◆ deg

rotationUnits vex::deg

◆ rev

rotationUnits vex::rev

◆ rpm

velocityUnits vex::rpm

◆ celsius

temperatureUnits vex::celsius

◆ fahrenheit

temperatureUnits vex::fahrenheit

◆ fwd

directionType vex::fwd

◆ coast

brakeType vex::coast

◆ brake

brakeType vex::brake

◆ hold

brakeType vex::hold

◆ ratio36_1

gearSetting vex::ratio36_1

◆ ratio18_1

gearSetting vex::ratio18_1

◆ ratio6_1

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

fontType vex::mono20

◆ mono30

fontType vex::mono30

◆ mono40

fontType vex::mono40

◆ mono60

fontType vex::mono60

◆ mono15

fontType vex::mono15

◆ mono12

fontType vex::mono12

◆ prop20

fontType vex::prop20

◆ prop30

fontType vex::prop30

◆ prop40

fontType vex::prop40

◆ prop60

fontType vex::prop60

◆ range8bit

analogUnits vex::range8bit

◆ range10bit

analogUnits vex::range10bit

◆ range12bit

analogUnits vex::range12bit

◆ mV

analogUnits vex::mV