|
VEX V5 C++ API
|
Use the optical class to control the optical sensor. More...
Inherits vex::device.
Public Member Functions | |
| optical (int32_t index) | |
| Creates a new optical sensor object on the port specified. More... | |
| ~optical () | |
| bool | installed () |
| int32_t | value () |
| double | hue () |
| Gets the hue detected by the optical sensor. More... | |
| double | brightness (bool bRaw=false) |
| Gets the brightness value detected by the optical sensor. More... | |
| vex::color | color () |
| Gets the detected color as saturated vex::color. More... | |
| bool | isNearObject () |
| Check to see if an object is detected by the optical sensor. More... | |
| void | setLight (ledState state) |
| Turns the led on the optical sensor on or off. More... | |
| void | setLight (int32_t intensity, percentUnits units=percentUnits::pct) |
| Set the intensity of the led on the optical sensor. More... | |
Public Member Functions inherited from vex::device | |
| device () | |
| device (int32_t index) | |
| ~device () | |
| V5_DeviceType | type () |
| void | init (int32_t index) |
Additional Inherited Members | |
Protected Attributes inherited from vex::device | |
| int32_t | _index |
Use the optical class to control the optical sensor.
| vex::optical::optical | ( | int32_t | index | ) |
Creates a new optical sensor object on the port specified.
| index | The port index for this sensor. The index is zero-based. |
| vex::optical::~optical | ( | ) |
|
virtual |
Reimplemented from vex::device.
|
virtual |
Reimplemented from vex::device.
| double vex::optical::hue | ( | ) |
Gets the hue detected by the optical sensor.
| double vex::optical::brightness | ( | bool | bRaw = false | ) |
Gets the brightness value detected by the optical sensor.
| vex::color vex::optical::color | ( | ) |
Gets the detected color as saturated vex::color.
| bool vex::optical::isNearObject | ( | ) |
Check to see if an object is detected by the optical sensor.
| void vex::optical::setLight | ( | ledState | state | ) |
Turns the led on the optical sensor on or off.
| void vex::optical::setLight | ( | int32_t | intensity, |
| percentUnits | units = percentUnits::pct |
||
| ) |
Set the intensity of the led on the optical sensor.
| intensity | light intensity, 0-100 |
| units | percent units, optional |
1.8.15