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

Use this class when programming with a light sensor. More...

Inherits vex::__tridevice.

Public Member Functions

 light (triport::port &port)
 Creates a new light object on the port specified in the parameter. More...
 
 ~light ()
 
int32_t value (analogUnits units)
 Gets the value of the light sensor. More...
 
int32_t value (percentUnits units)
 Gets the value of the light sensor. More...
 

Detailed Description

Use this class when programming with a light sensor.

Constructor & Destructor Documentation

◆ light()

vex::light::light ( triport::port port)

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

Parameters
portA reference to a three wire port.

◆ ~light()

vex::light::~light ( )

Member Function Documentation

◆ value() [1/2]

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

Gets the value of the light sensor.

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

◆ value() [2/2]

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

Gets the value of the light sensor.

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