[−][src]Struct librobot::navigation::Motor
Un moteur avec ses deux broches : vitesse et direction.
Methods
impl<MOT, DIR> Motor<MOT, DIR> where
MOT: PwmPin<Duty = u16>,
DIR: OutputPin,
[src]
MOT: PwmPin<Duty = u16>,
DIR: OutputPin,
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
Auto Trait Implementations
impl<MOT, DIR> Send for Motor<MOT, DIR> where
DIR: Send,
MOT: Send,
DIR: Send,
MOT: Send,
impl<MOT, DIR> Sync for Motor<MOT, DIR> where
DIR: Sync,
MOT: Sync,
DIR: Sync,
MOT: Sync,
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self