pub struct Position { /* private fields */ }Expand description
Motor position tracker.
Maintains absolute position in steps and provides unit conversions.
Implementations§
Source§impl Position
impl Position
Sourcepub fn at(steps: Steps, steps_per_degree: f32) -> Self
pub fn at(steps: Steps, steps_per_degree: f32) -> Self
Create a position tracker at a specific position.
Sourcepub fn set_degrees(&mut self, degrees: Degrees)
pub fn set_degrees(&mut self, degrees: Degrees)
Set position in degrees.
Sourcepub fn move_steps(&mut self, delta: i64)
pub fn move_steps(&mut self, delta: i64)
Move by a number of steps.
Sourcepub fn move_degrees(&mut self, delta: Degrees)
pub fn move_degrees(&mut self, delta: Degrees)
Move by an amount in degrees.
Sourcepub fn set_origin(&mut self)
pub fn set_origin(&mut self)
Set current position as the new origin.
Sourcepub fn steps_per_degree(&self) -> f32
pub fn steps_per_degree(&self) -> f32
Get steps per degree conversion factor.
Trait Implementations§
impl Copy for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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