VEXcode Doxygen
Public Member Functions | Public Attributes | List of all members
vex::line Class Reference

Use this class when programming with a line follower. More...

#include <vex_triport.h>

Inheritance diagram for vex::line:
vex::__tridevice

Public Member Functions

 line (triport::port &port)
 Creates a new line object on the port specified in the parameter. More...
 
int32_t value (analogUnits units)
 Gets the value of the line follower. More...
 
int32_t reflectivity (percentUnits units=percentUnits::pct)
 
int32_t value (percentUnits units)
 Gets the value of the line follower. More...
 
void changed (void(*callback)(void))
 Calls a function when the line sensor value changes. More...
 

Public Attributes

mevent & CHANGED = _CHANGED
 

Detailed Description

Use this class when programming with a line follower.

@prog_lang{block|cpp|pro}

Constructor & Destructor Documentation

◆ line()

vex::line::line ( triport::port port)

Creates a new line object on the port specified in the parameter.

@prog_lang{cpp|pro} @drawer_cat{constructor} @block_sig{vex::line Line = vex::line(Brain.ThreeWirePort.A);}

Parameters
portA reference to a three wire port.

Member Function Documentation

◆ changed()

void vex::line::changed ( void(*)(void)  callback)

Calls a function when the line sensor value changes.

@prog_lang{pro} @drawer_cat{sensing} @block_sig{Line.changed(changedFunction);}

Parameters
callbackA reference to a function.

◆ value() [1/2]

int32_t vex::line::value ( analogUnits  units)

Gets the value of the line follower.

@prog_lang{cpp|pro} @drawer_cat{sensing} @block_sig{Line.value(vex::analogUnits::range8bit)}

Returns
Returns an integer that represents the unit value specified by the parameter of the line follower.
Parameters
unitsThe measurement unit for the line device.

◆ value() [2/2]

int32_t vex::line::value ( percentUnits  units)
inline

Gets the value of the line follower.

@prog_lang{block|cpp|pro} @drawer_cat{sensing} @block_sig{Line.value(percent)} @cpp_sig{Line.value(vex::percentUnits::pct)}

Returns
Returns an integer that represents the unit value specified by the parameter of the line follower.
Parameters
unitsThe measurement unit for the line device.

The documentation for this class was generated from the following file: