pros/optical.h file

Contents

Contains prototypes for functions related to the VEX Optical sensor.

This file should not be modified by users, since it gets replaced whenever a kernel upgrade occurs.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Namespaces

namespace pros
LLEMU Conditional Include
namespace pros::c

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.

Enums

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

Defines

#define OPT_GESTURE_ERR
#define OPT_COUNT_ERR
#define OPT_TIME_ERR