VEX Optical Sensor C API module

Contents

Files

file optical.h
Contains prototypes for functions related to the VEX Optical sensor.

Classes

struct optical_rgb_s_t
The RGB and Brightness values for the optical sensor.
struct optical_raw_s_t
The RGB and clear values for the optical sensor.
struct optical_gesture_s_t
This structure contains the raw gesture data.

Functions

double optical_get_hue(uint8_t port)
Get the detected color hue.
double optical_get_saturation(uint8_t port)
Get the detected color saturation.
double optical_get_brightness(uint8_t port)
Get the detected color brightness.
int32_t optical_get_proximity(uint8_t port)
Get the detected proximity value.
int32_t optical_set_led_pwm(uint8_t port, uint8_t value)
Set the pwm value of the White LED.
int32_t optical_get_led_pwm(uint8_t port)
Get the pwm value of the White LED.
optical_rgb_s_t optical_get_rgb(uint8_t port)
Get the processed RGBC data from the sensor.
optical_raw_s_t optical_get_raw(uint8_t port)
Get the raw, unprocessed RGBC data from the sensor.
optical_direction_e_t optical_get_gesture(uint8_t port)
Get the most recent gesture data from the sensor.
optical_gesture_s_t optical_get_gesture_raw(uint8_t port)
Get the most recent raw gesture data from the sensor.
int32_t optical_enable_gesture(uint8_t port)
Enable gesture detection on the sensor.
int32_t optical_disable_gesture(uint8_t port)
Disable gesture detection on the sensor.
double optical_get_integration_time(uint8_t port)
Get integration time (update rate) of the optical sensor in milliseconds, with minimum time being.
int32_t optical_set_integration_time(uint8_t port, double time)
Set integration time (update rate) of the optical sensor in milliseconds.

Enums

enum optical_direction_e_t { NO_GESTURE = 0, UP = 1, DOWN = 2, RIGHT = 3, LEFT = 4, ERROR = PROS_ERR }

Enum documentation

enum optical_direction_e_t

Enumerators
NO_GESTURE

UP

The direction indicating an upward gesture.

DOWN

The direction indicating a downward gesture.

RIGHT

The direction indicating a rightward gesture.

LEFT

The direction indicating a leftward gesture.

ERROR