VEX V5 C++ API
Public Member Functions | Friends | List of all members
vex::triport::port Class Reference

Use this class to get access to port functions and members. More...

Public Member Functions

 port ()
 
 port (const int32_t id, triport *parent)
 
 port (const int32_t id, const triportType type, triport *parent)
 
 ~port ()
 
void type (const triportType type)
 
triportType type ()
 Gets the current port type. More...
 
void value (int32_t value)
 Sets the port's value to the specified integer in the parameter. More...
 
int32_t value ()
 Gets the value of a port. More...
 
void set (bool value)
 Sets the value of the port to a Boolean value. More...
 
void operator() (const triportType type)
 
void operator= (const int32_t value)
 
 operator int ()
 
 operator bool ()
 
void resetRotation (void)
 Resets the rotation of the encoder to zero. More...
 
void setRotation (double val, rotationUnits units)
 Sets the rotation of the encoder to a specific value. More...
 
double rotation (rotationUnits units)
 Gets the rotation value of the encoder. More...
 
double velocity (velocityUnits units)
 Gets the velocity of the encoder. More...
 
double distance (distanceUnits units)
 Gets the value of the distance sensor. More...
 

Friends

class __tridevice
 
class pot
 
class gyro
 

Detailed Description

Use this class to get access to port functions and members.

Constructor & Destructor Documentation

◆ port() [1/3]

vex::triport::port::port ( )
inline

◆ port() [2/3]

vex::triport::port::port ( const int32_t  id,
triport parent 
)

◆ port() [3/3]

vex::triport::port::port ( const int32_t  id,
const triportType  type,
triport parent 
)

◆ ~port()

vex::triport::port::~port ( )
inline

Member Function Documentation

◆ type() [1/2]

void vex::triport::port::type ( const triportType  type)
@brief Sets the port to a specific port type.
Parameters
typeA type of port that you want to set it to.

◆ type() [2/2]

triportType vex::triport::port::type ( )

Gets the current port type.

Returns
Returns the Port Type.

◆ value() [1/2]

void vex::triport::port::value ( int32_t  value)

Sets the port's value to the specified integer in the parameter.

Parameters
valueAn integer number that will be set to the port's value.

◆ value() [2/2]

int32_t vex::triport::port::value ( )

Gets the value of a port.

Returns
Returns an integer that represents the port's value.

◆ set()

void vex::triport::port::set ( bool  value)

Sets the value of the port to a Boolean value.

Parameters
valueA true or false Boolean value that the port will be set to.

◆ operator()()

void vex::triport::port::operator() ( const triportType  type)
inline

◆ operator=()

void vex::triport::port::operator= ( const int32_t  value)
inline

◆ operator int()

vex::triport::port::operator int ( )
inline

◆ operator bool()

vex::triport::port::operator bool ( )
inline

◆ resetRotation()

void vex::triport::port::resetRotation ( void  )

Resets the rotation of the encoder to zero.

◆ setRotation()

void vex::triport::port::setRotation ( double  val,
rotationUnits  units 
)

Sets the rotation of the encoder to a specific value.

Parameters
valA double that represents the value to set the rotation to.
unitsThe unit type that the previous value should be treated as.

◆ rotation()

double vex::triport::port::rotation ( rotationUnits  units)

Gets the rotation value of the encoder.

Returns
Returns a double that represents the current rotation of the encoder.
Parameters
unitsA unit type that defines what value of rotation that should be returned.

◆ velocity()

double vex::triport::port::velocity ( velocityUnits  units)

Gets the velocity of the encoder.

Returns
Returns a double that represents the current velocity of the encoder.
Parameters
unitsA unit type that defines what value of velocity that should be returned.

◆ distance()

double vex::triport::port::distance ( distanceUnits  units)

Gets the value of the distance sensor.

Returns
Returns a double that represents the current distance of the sensor.
Parameters
unitsA distance unit type that defines what value of distance that should be returned.

Friends And Related Function Documentation

◆ __tridevice

friend class __tridevice
friend

◆ pot

friend class pot
friend

◆ gyro

friend class gyro
friend