pros::v5::Optical class

Base classes

class Device

Public static functions

static std::vector<Optical> get_all_devices()
Gets all optical sensors.

Constructors, destructors, conversion operators

Optical(const std::uint8_t port)
Creates an Optical Sensor object for the given port.
Optical(const Device& device)

Public functions

double get_hue() virtual
Get the detected color hue.
double get_saturation() virtual
Get the detected color saturation.
double get_brightness() virtual
Get the detected color brightness.
std::int32_t get_proximity() virtual
Get the detected proximity value.
std::int32_t set_led_pwm(uint8_t value) virtual
Set the pwm value of the White LED on the sensor.
std::int32_t get_led_pwm() virtual
Get the pwm value of the White LED on the sensor.
pros::c::optical_rgb_s_t get_rgb() virtual
Get the processed RGBC data from the sensor.
pros::c::optical_raw_s_t get_raw() virtual
Get the raw un-processed RGBC data from the sensor.
pros::c::optical_direction_e_t get_gesture() virtual
Get the most recent gesture data from the sensor.
pros::c::optical_gesture_s_t get_gesture_raw() virtual
Get the most recent raw gesture data from the sensor.
std::int32_t enable_gesture() virtual
Enable gesture detection on the sensor.
std::int32_t disable_gesture() virtual
Disable gesture detection on the sensor.

Friends

std::ostream& operator<<(std::ostream& os, pros::Optical& optical)
This is the overload for the << operator for printing to streams.