pub enum Drive {
Wave,
FullStep,
HalfStep,
}Expand description
A stepper drive pattern.
The three patterns trade torque, smoothness, and resolution. Wave drive energises one coil at a time (least torque, least power); full-step energises two at a time (most torque); half-step alternates between them to double the resolution at the cost of uneven torque.
Variants§
Wave
One coil energised at a time: four steps.
FullStep
Two adjacent coils energised at a time: four steps, more torque.
HalfStep
Alternating one and two coils: eight steps, double resolution.
Implementations§
Source§impl Drive
impl Drive
Sourcepub fn pattern(self) -> &'static [u8]
pub fn pattern(self) -> &'static [u8]
Returns the coil patterns for this drive, in forward order.
§Returns
A slice of four-bit coil patterns: four for wave and full-step, eight for half-step.
Sourcepub fn step_count(self) -> usize
pub fn step_count(self) -> usize
Returns how many steps make up one full electrical cycle of this drive.
§Returns
4 for wave and full-step, 8 for half-step.
Trait Implementations§
impl Copy for Drive
impl Eq for Drive
impl StructuralPartialEq for Drive
Auto Trait Implementations§
impl Freeze for Drive
impl RefUnwindSafe for Drive
impl Send for Drive
impl Sync for Drive
impl Unpin for Drive
impl UnsafeUnpin for Drive
impl UnwindSafe for Drive
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