[][src]Struct drs_0x01::Servo

pub struct Servo { /* fields omitted */ }

This struct allows you to build messages for a servomotor.

Methods

impl Servo[src]

pub fn new(id: u8) -> Servo[src]

Create a new Servo with the given ID.

Notes

  • Valid ID are in the range 0..253.
  • 254 is the broadcast ID.

pub fn set_id(&mut self, id: u8)[src]

Change the servo ID.

pub fn id(self) -> u8[src]

Return the servo ID.

pub fn reboot(self) -> HerkulexMessage[src]

Create a reboot message requesting the servo to reboot. During the reboot all changes applied to the EEP memory will take effect.

pub fn set_position(self, position: u16) -> HerkulexMessage[src]

Request the servo to go to a position. The value can be between 0 and 1023 but should be between 21 and 1002 if you don't want the servomotor to go in error mode.

pub fn set_speed(self, speed: u16, rotation: Rotation) -> HerkulexMessage[src]

Request the servo to have a certain speed. The value should be between 0 and 1023.

pub fn stat(self) -> HerkulexMessage[src]

Request the servo to send it's status.

pub fn ram_write(self, addr: WritableRamAddr) -> HerkulexMessage[src]

Write to the volatile RAM of the servo. Ram is cleared on every reboot, and populated with data from the EEP memory.

pub fn eep_write(self, addr: WritableEEPAddr) -> HerkulexMessage[src]

Write to the permanent EEP memory. For the change to take effect you need to reboot the servo so that the values are loaded in RAM.

pub fn ram_request(self, addr: ReadableRamAddr) -> HerkulexMessage[src]

Request the servo to send back some data from RAM.

pub fn eep_request(self, addr: ReadableEEPAddr) -> HerkulexMessage[src]

Request the servo to send back some data from EEP.

pub fn enable_torque(self) -> HerkulexMessage[src]

Request the servo to enable torque.

pub fn disable_torque(self) -> HerkulexMessage[src]

Request the servo to disable torque.

pub fn clear_errors(self) -> HerkulexMessage[src]

Clear the error register of the servo.

Trait Implementations

impl Copy for Servo[src]

impl Debug for Servo[src]

impl Clone for Servo[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Servo[src]

Auto Trait Implementations

impl Send for Servo

impl Sync for Servo

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, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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