pub struct AnalogStick { /* private fields */ }Expand description
Represents one of two analog sticks on a Vex controller.
Implementations§
Source§impl AnalogStick
impl AnalogStick
Sourcepub fn get_x(&self) -> Result<i8, ControllerError>
pub fn get_x(&self) -> Result<i8, ControllerError>
Reads an analog stick’s x-axis. Returns a value on the range [-127, 127] where -127 is all the way left, 0 is centered, and 127 is all the way right. Also returns 0 if controller is not connected.
Sourcepub fn get_y(&self) -> Result<i8, ControllerError>
pub fn get_y(&self) -> Result<i8, ControllerError>
Reads an analog stick’s y-axis. Returns a value on the range [-127, 127] where -127 is all the way down, 0 is centered, and 127 is all the way up. Also returns 0 if controller is not connected.
Auto Trait Implementations§
impl Freeze for AnalogStick
impl RefUnwindSafe for AnalogStick
impl Send for AnalogStick
impl Sync for AnalogStick
impl Unpin for AnalogStick
impl UnwindSafe for AnalogStick
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more