Struct drs_0x01::prelude::Servo [−][src]
pub struct Servo { /* fields omitted */ }
This struct allows you to quickly build messages for a servomotor.
Methods
impl Servo
[src]
impl Servo
pub fn new(id: u8) -> Servo
[src]
pub fn new(id: u8) -> Servo
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]
pub fn set_id(&mut self, id: u8)
Change the servo ID.
pub fn id(&self) -> u8
[src]
pub fn id(&self) -> u8
Return the servo ID.
pub fn reboot(&self) -> HerkulexMessage
[src]
pub fn reboot(&self) -> HerkulexMessage
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]
pub fn set_position(&self, position: u16) -> HerkulexMessage
Request the servo to go to a position.
pub fn set_speed(&self, speed: u16) -> HerkulexMessage
[src]
pub fn set_speed(&self, speed: u16) -> HerkulexMessage
Request the servo to have a certain speed.
pub fn stat(&self) -> HerkulexMessage
[src]
pub fn stat(&self) -> HerkulexMessage
Request the servo to send it's status.
pub fn ram_write(&self, addr: WritableRamAddr) -> HerkulexMessage
[src]
pub fn ram_write(&self, addr: WritableRamAddr) -> HerkulexMessage
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]
pub fn eep_write(&self, addr: WritableEEPAddr) -> HerkulexMessage
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]
pub fn ram_request(&self, addr: ReadableRamAddr) -> HerkulexMessage
Request the servo to send back some data from RAM.
pub fn eep_request(&self, addr: ReadableEEPAddr) -> HerkulexMessage
[src]
pub fn eep_request(&self, addr: ReadableEEPAddr) -> HerkulexMessage
Request the servo to send back some data from EEP.
pub fn enable_torque(&self) -> HerkulexMessage
[src]
pub fn enable_torque(&self) -> HerkulexMessage
Request the servo to enable torque.
pub fn disable_torque(&self) -> HerkulexMessage
[src]
pub fn disable_torque(&self) -> HerkulexMessage
Request the servo to disable torque.
pub fn clear_errors(&self) -> HerkulexMessage
[src]
pub fn clear_errors(&self) -> HerkulexMessage
Clear the error register of the servo.
Trait Implementations
impl Copy for Servo
[src]
impl Copy for Servo
impl Clone for Servo
[src]
impl Clone for Servo
fn clone(&self) -> Servo
[src]
fn clone(&self) -> Servo
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Servo
[src]
impl Debug for Servo
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Servo
[src]
impl Default for Servo