How to contol servo speed from serial
November 24, 2012
I have renbotics ServoShield and I have made a code on arduino where from serialport I can send commads to servos and it happens with that way... S01P1200,S14P2300etc..I mean that Servo 1 to 1200 posion and servo 14 to 2300 posion
NowI have one problem.How can I control the servo's speed from serial port? For example S01P1200F.... 1 SERVO, 1200 POSION, F = SPEED...Is there any code for controlling servos speed so that I can take it and include it into my code? As I know servoshield 1.5 library I use , can't support any speed control.
My code that moves servo is this , but how can I contol the speed?o you have any clue?
char servoid[extractedCommand.substring(1,3).length() + 1];
char servopos[extractedCommand.substring(4,8).length() + 1];
// Convert extracted strings to integers
int sid = atoi(servoid);
int spos = atoi(servopos);
//Print some debug info
sprintf(debugMsg,"command string: %s Servo Id: %d Servo Position: %d", command, sid, spos);
// Move the
shieldServos.setposition(sid , spos);