...
The Lynxmotion Smart Servos (LSS) are compact, modular and configurable actuators designed to be an evolution of the standard RC servo for use in multi-degree-of-freedom robotics. The servo lineup currently includes three “smart servos” which appear physically the same, sharing the same dimensions, mounting points and output spline, 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:
...
This example is for changing the ID of the servo motor.
Code Block | ||
---|---|---|
| ||
#include <LSS.h> #include <SoftwareSerial.h> SoftwareSerial servoSerial(8, 9); // ID set to default LSS ID = 0 #define LSS_ID_old (254) // ID 254 to broadcast to every motor on bus #define LSS_ID 1 (0) void setup(#define LSS_BAUD (LSS_DefaultBaud) { // setCreate theone dataLSS rateobject forLSS themyLSS SoftwareSerial port, 115200 is default for lynxmotion= LSS(LSS_ID); void setup() { // set the data rate for the SoftwareSerial port servoSerial.begin(115200LSS_BAUD); // this is used to clear the serial buffer servoSerial.print("#0D1500\r"); delay(1000); LSS::initBus(servoSerial, LSS_BAUD); // change IDUncomment next two line for factory reset //servoSerial.print(String("#") + LSS_ID_old + String("DEFAULT")+"\r"); //servoSerial.print(String("CID#") + LSS_ID_old + String("CONFIRM")+"\r"); //change UncommentID next line for factory reset //servoSerial.print(String("#") + LSS_ID_old + String("DEFAULTCID") + LSS_ID + "\r"); delay(2000); } // a reset is required for the changes to take effectvoid loop() { } |
This example cycles through the LED colours of the smart servos.
...