Struct ev3dev_lang_rust::sensors::ColorSensor [−][src]
pub struct ColorSensor { /* fields omitted */ }LEGO EV3 color sensor.
Implementations
impl ColorSensor[src]
impl ColorSensor[src]pub fn get(port: SensorPort) -> Ev3Result<Self>[src]
Try to get a Self on the given port. Returns None if port is not used or another device is connected.
pub fn find() -> Ev3Result<Self>[src]
Try to find a Self. Only returns a motor if their is exactly one connected, Error::NotFound otherwise.
pub fn list() -> Ev3Result<Vec<Self>>[src]
Extract list of connected ‘Self’
pub const MODE_COL_REFLECT: &'static str[src]
Reflected light - sets LED color to red
pub fn set_mode_col_reflect(&self) -> Ev3Result<()>[src]
Reflected light - sets LED color to red
pub fn is_mode_col_reflect(&self) -> Ev3Result<bool>[src]
Reflected light - sets LED color to red
pub const MODE_COL_AMBIENT: &'static str[src]
Ambient light - sets LED color to blue (dimly lit)
pub fn set_mode_col_ambient(&self) -> Ev3Result<()>[src]
Ambient light - sets LED color to blue (dimly lit)
pub fn is_mode_col_ambient(&self) -> Ev3Result<bool>[src]
Ambient light - sets LED color to blue (dimly lit)
pub const MODE_COL_COLOR: &'static str[src]
Color - sets LED color to white (all LEDs rapidly cycling)
pub fn set_mode_col_color(&self) -> Ev3Result<()>[src]
Color - sets LED color to white (all LEDs rapidly cycling)
pub fn is_mode_col_color(&self) -> Ev3Result<bool>[src]
Color - sets LED color to white (all LEDs rapidly cycling)
pub const MODE_REF_RAW: &'static str[src]
Raw Reflected - sets LED color to red
pub fn set_mode_ref_raw(&self) -> Ev3Result<()>[src]
Raw Reflected - sets LED color to red
pub fn is_mode_ref_raw(&self) -> Ev3Result<bool>[src]
Raw Reflected - sets LED color to red
pub const MODE_RGB_RAW: &'static str[src]
Raw Color Components - sets LED color to white (all LEDs rapidly cycling)
pub fn set_mode_rgb_raw(&self) -> Ev3Result<()>[src]
Raw Color Components - sets LED color to white (all LEDs rapidly cycling)
pub fn is_mode_rgb_raw(&self) -> Ev3Result<bool>[src]
Raw Color Components - sets LED color to white (all LEDs rapidly cycling)
pub const MODE_COL_CAL: &'static str[src]
Calibration ??? - sets LED color to red, flashing every 4 seconds, then goes continuous
pub fn set_mode_col_cal(&self) -> Ev3Result<()>[src]
Calibration ??? - sets LED color to red, flashing every 4 seconds, then goes continuous
pub fn is_mode_col_cal(&self) -> Ev3Result<bool>[src]
Calibration ??? - sets LED color to red, flashing every 4 seconds, then goes continuous
pub fn get_color(&self) -> Ev3Result<i32>[src]
Get the color value for the modes COL-REFLECT, COL-AMBIENT, COL-COLOR and REF-RAW.
pub fn get_red(&self) -> Ev3Result<i32>[src]
Red component of the detected color, in the range 0-1020.
pub fn get_green(&self) -> Ev3Result<i32>[src]
Green component of the detected color, in the range 0-1020.
pub fn get_blue(&self) -> Ev3Result<i32>[src]
Blue component of the detected color, in the range 0-1020.
pub fn get_rgb(&self) -> Ev3Result<(i32, i32, i32)>[src]
Red, green and blue componets of the detected color, each in the range 0-1020
Trait Implementations
impl Clone for ColorSensor[src]
impl Clone for ColorSensor[src]fn clone(&self) -> ColorSensor[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Device for ColorSensor[src]
impl Device for ColorSensor[src]fn get_attribute(&self, name: &str) -> Attribute[src]
fn get_address(&self) -> Ev3Result<String>[src]
fn set_command(&self, command: &str) -> Ev3Result<()>[src]
fn get_commands(&self) -> Ev3Result<Vec<String>>[src]
fn get_driver_name(&self) -> Ev3Result<String>[src]
impl Sensor for ColorSensor[src]
impl Sensor for ColorSensor[src]fn get_bin_data(&self) -> Ev3Result<String>[src]
fn get_bin_data_format(&self) -> Ev3Result<String>[src]
fn get_decimals(&self) -> Ev3Result<i32>[src]
fn get_fw_version(&self) -> Ev3Result<String>[src]
fn get_mode(&self) -> Ev3Result<String>[src]
fn set_mode(&self, mode: &str) -> Ev3Result<()>[src]
fn get_modes(&self) -> Ev3Result<Vec<String>>[src]
fn get_num_values(&self) -> Ev3Result<i32>[src]
fn get_poll_ms(&self) -> Ev3Result<i32>[src]
fn set_poll_ms(&self, poll_ms: i32) -> Ev3Result<()>[src]
fn get_units(&self) -> Ev3Result<String>[src]
fn get_value(&self, index: u8) -> Ev3Result<i32>[src]
fn get_value0(&self) -> Ev3Result<i32>[src]
fn get_value1(&self) -> Ev3Result<i32>[src]
fn get_value2(&self) -> Ev3Result<i32>[src]
fn get_value3(&self) -> Ev3Result<i32>[src]
fn get_value4(&self) -> Ev3Result<i32>[src]
fn get_value5(&self) -> Ev3Result<i32>[src]
fn get_value6(&self) -> Ev3Result<i32>[src]
fn get_value7(&self) -> Ev3Result<i32>[src]
fn get_text_value(&self) -> Ev3Result<String>[src]
Auto Trait Implementations
impl !RefUnwindSafe for ColorSensor
impl !RefUnwindSafe for ColorSensorimpl Send for ColorSensor
impl Send for ColorSensorimpl !Sync for ColorSensor
impl !Sync for ColorSensorimpl Unpin for ColorSensor
impl Unpin for ColorSensorimpl UnwindSafe for ColorSensor
impl UnwindSafe for ColorSensor