pub struct Servo { /* private fields */ }
Expand description
This struct allows you to build messages for a servomotor.
Implementations
sourceimpl Servo
impl Servo
sourcepub fn new(id: u8) -> Servo
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.
sourcepub fn reboot(self) -> HerkulexMessage
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.
sourcepub fn set_position(self, position: u16) -> HerkulexMessage
pub fn set_position(self, position: u16) -> HerkulexMessage
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 fo go in error mode.
sourcepub fn set_speed(self, speed: u16) -> HerkulexMessage
pub fn set_speed(self, speed: u16) -> HerkulexMessage
Request the servo to have a certain speed. The value should be between 0 and 1023.
sourcepub fn stat(self) -> HerkulexMessage
pub fn stat(self) -> HerkulexMessage
Request the servo to send it’s status.
sourcepub fn ram_write(self, addr: WritableRamAddr) -> HerkulexMessage
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.
sourcepub fn eep_write(self, addr: WritableEEPAddr) -> HerkulexMessage
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.
sourcepub fn ram_request(self, addr: ReadableRamAddr) -> HerkulexMessage
pub fn ram_request(self, addr: ReadableRamAddr) -> HerkulexMessage
Request the servo to send back some data from RAM.
sourcepub fn eep_request(self, addr: ReadableEEPAddr) -> HerkulexMessage
pub fn eep_request(self, addr: ReadableEEPAddr) -> HerkulexMessage
Request the servo to send back some data from EEP.
sourcepub fn enable_torque(self) -> HerkulexMessage
pub fn enable_torque(self) -> HerkulexMessage
Request the servo to enable torque.
sourcepub fn disable_torque(self) -> HerkulexMessage
pub fn disable_torque(self) -> HerkulexMessage
Request the servo to disable torque.
sourcepub fn clear_errors(self) -> HerkulexMessage
pub fn clear_errors(self) -> HerkulexMessage
Clear the error register of the servo.