...
The Lynxmotion Smart Servos (LSS) are compact, modular and configurable actuators that provide greater control than standard PWM servos. The servo lineup currently includes three “smart servos” which appear physically the same, sharing the same dimensions and mounting points but differing in maximum torque and speed.
...
The lynx motion has a simple serial protocol for controlling the motor, that is human-readable:
Number sign #
Servo ID number as an integer
Action command (two to three letters, no spaces, capital or lower case)
Configuration value in the correct units with no decimal
End with a control / carriage return '<cr>'
Ex: #5PD1443<cr>
Additional Parts:
...
Code Block | ||
---|---|---|
| ||
#include <LSS<SoftwareSerial.h> #include <SoftwareSerial.h> #define rxPin 8 #define txPin 9 SoftwareSerial servoSerialmySerial(8rxPin, 9txPin); // Create the new software serial instance #define LSS_ID ( 254) // ID 254 to broadcast to every motor on bus #define LSS_BAUD (LSS_DefaultBaud) // Create one LSS object LSS myLSS = LSS(LSS_ID); void setup() { servoSerial.begin(LSS_BAUD); void setup() { servoSerial.begin(115200); // Important! this is the standard speed for talking to LSS mySerial.print("#0D1500\r"); // Initializethis theis LSSused busto clear LSS::initBus(servoSerial, LSS_BAUD); Serial.begin(LSS_BAUD);the serial buffer } void loop() { // Move the LSS continuously in one direction myLSSmySerial.wheelRPM(10); delay(5000); // Move the LSS continuously in the oposite direction myLSS.wheelRPM(-10); delay(5000print(String("#") + LSS_ID + String("WR") + 10 + "\r"); // RPM move delay(5000); // Move the LSS continuously in the oposite direction mySerial.print(String("#") + LSS_ID + String("WR") + -10 + "\r"); // RPM move delay(5000); // faster! mySerial.print(String("#") + LSS_ID + String("WR") + -60 + "\r"); // RPM move delay(3000); // go fasterLimp! myLSS.wheelRPM(-60); delay(3000); // go Limp! myLSS.limp(); mySerial.print(String("#") + LSS_ID + String("L") + "\r"); // Limp delay(5000); // move relative from current position in 1/10° (i.e 100 = 10 degrees) myLSS.moveRelative(100); degrees) mySerial.print(String("#") + LSS_ID + String("D") + int(60*10) + "\r"); // move 100 degrees delay(5000); // Move to specific position in 1/10° (i.e 100 = 10 degrees) myLSS.move(400);mySerial.print(String("#") + LSS_ID + String("D") + int(360*10) + "\r"); // move 360 degrees delay(7000); } |
Multiple Servos
...