[][src]Struct librobot::navigation::Motor

pub struct Motor<MOT, DIR> where
    MOT: PwmPin<Duty = u16>,
    DIR: OutputPin
{ /* fields omitted */ }

Un moteur avec ses deux broches : vitesse et direction.

Methods

impl<MOT, DIR> Motor<MOT, DIR> where
    MOT: PwmPin<Duty = u16>,
    DIR: OutputPin
[src]

pub fn new(pwm: MOT, dir: DIR) -> Self[src]

Crée une nouvelle structure de gestion moteur à partir d'une broche de direction et d'une broche de PWM :

  • la PWM commande la vitesse : son duty cycle est proportionnel à la vitesse voulue du moteur
  • la broche d'entrée sortie controle la direction du moteur

pub fn apply_command(&mut self, cmd: Command)[src]

Applique la commande de direction et de vitesse aux moteurs :

  • avancer correspond à un état bas sur la broche de direction
  • reculer correspond à un état haut sur la broche de direction

Trait Implementations

impl<MOT, DIR> Debug for Motor<MOT, DIR> where
    MOT: PwmPin<Duty = u16>,
    DIR: OutputPin
[src]

Auto Trait Implementations

impl<MOT, DIR> Send for Motor<MOT, DIR> where
    DIR: Send,
    MOT: Send

impl<MOT, DIR> Sync for Motor<MOT, DIR> where
    DIR: Sync,
    MOT: Sync

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self