VEX IQ Python API
|
Config Color Sensor: detects color hue or a grayscale value. More...
Public Member Functions | |
def | __init__ (self, port=None, is_graysale=False, proximity=700) |
def | set_proximity_threshold (self, proximity) |
Set the proximity threshold setting. More... | |
def | set_grayscale_mode (self, is_grayscale) |
Turn grayscale mode setting on (True) or off (False). More... | |
def | named_color (self) |
Get color as a number corresponding to a NamedColor value. More... | |
def | raw_color (self) |
Get raw color info as a tuple of ints (red, green, blue, brightness). More... | |
def | grayscale (self) |
Get grayscale value in the [0-100] range. More... | |
def | led_on (self) |
Turn on the LED. More... | |
def | led_off (self) |
Turn off the LED. More... | |
Config Color Sensor: detects color hue or a grayscale value.
port | 1-12, None to autodetect. Default None. |
is_grayscale | True if grayscale mode, False if color mode. Default False. |
proximity | Set proximity threshold. Default 700. |
def vexiq.ColorSensor.__init__ | ( | self, | |
port = None , |
|||
is_graysale = False , |
|||
proximity = 700 |
|||
) |
def vexiq.ColorSensor.set_proximity_threshold | ( | self, | |
proximity | |||
) |
Set the proximity threshold setting.
Higher is closer.
proximity | threshold |
def vexiq.ColorSensor.set_grayscale_mode | ( | self, | |
is_grayscale | |||
) |
Turn grayscale mode setting on (True) or off (False).
is_grayscale | True if grayscale, False if color |
def vexiq.ColorSensor.named_color | ( | self | ) |
Get color as a number corresponding to a NamedColor value.
def vexiq.ColorSensor.raw_color | ( | self | ) |
Get raw color info as a tuple of ints (red, green, blue, brightness).
def vexiq.ColorSensor.grayscale | ( | self | ) |
Get grayscale value in the [0-100] range.
def vexiq.ColorSensor.led_on | ( | self | ) |
Turn on the LED.
def vexiq.ColorSensor.led_off | ( | self | ) |
Turn off the LED.