|
VEX V5 Python API
|
Use the optical class to control the optical sensor. More...
Inherits vex.Device.
Public Member Functions | |
| def | __init__ (self, index) |
| Creates a new optical sensor object on the port specified. More... | |
| def | hue (self) |
| Gets the hue detected by the optical sensor. More... | |
| def | brightness (self, raw=False) |
| Gets the brightness value detected by the optical sensor. More... | |
| def | color (self) |
| Gets the detected color as saturated vex::color. More... | |
| def | color_int (self) |
| Gets the detected color as saturated int value. More... | |
| def | is_near_object (self) |
| Check to see if an object is detected by the optical sensor. More... | |
| def | set_light (self, ledState) |
| Turns the led on the optical sensor on or off. More... | |
| def | set_light_pct (self, intensity, percentUnits=PercentUnits.PCT) |
| Set the intensity of the led on the optical sensor. More... | |
| def | type (self) |
| Get the device type. More... | |
| def | installed (self) |
| Gets the status of what is installed. More... | |
| def | value (self) |
Use the optical class to control the optical sensor.
| def vex.Optical.__init__ | ( | self, | |
| index | |||
| ) |
Creates a new optical sensor object on the port specified.
| index | The port index for this sensor. The index is zero based. |
Reimplemented from vex.Device.
| def vex.Optical.hue | ( | self | ) |
Gets the hue detected by the optical sensor.
| def vex.Optical.brightness | ( | self, | |
raw = False |
|||
| ) |
Gets the brightness value detected by the optical sensor.
| def vex.Optical.color | ( | self | ) |
Gets the detected color as saturated vex::color.
| def vex.Optical.color_int | ( | self | ) |
Gets the detected color as saturated int value.
| def vex.Optical.is_near_object | ( | self | ) |
Check to see if an object is detected by the optical sensor.
| def vex.Optical.set_light | ( | self, | |
| ledState | |||
| ) |
Turns the led on the optical sensor on or off.
| ledState | a boolean or a vex.LedState value, ON or OFF |
| def vex.Optical.set_light_pct | ( | self, | |
| intensity, | |||
percentUnits = PercentUnits.PCT |
|||
| ) |
Set the intensity of the led on the optical sensor.
| intensity | light intensity, 0-100 |
| percentUnits | (optional) percent unit |
|
inherited |
Get the device type.
|
inherited |
Gets the status of what is installed.
|
inherited |
1.8.15