Hi guys
Im sitting with my Panda 2, and this serial controlled servo controller: http://www.pololu.com/file/download/ssc03a_guide.pdf?file_id=0J37
And it got 2 modes. a super simple one, where i can send a couple of byte values (servo number and position)…
As described on page 5…
That works perfectly, but i really wanna use the more advanced mode (Pololu mode, Page 6), so i can fx. set a speed of rotation.
But i cant seem to understand exactly what to send for that.
This i what ive done:
I removed the jumper, to enable the Pololu Mode.
Then ive made some code to send, what i think is right:
public void MoveTo2(byte servoNumber, byte servoPos, byte speed = 0, byte sync = 128, byte deviceId = 1)
{
//Set speed
SendBytes(sync);
SendBytes(deviceId);
SendBytes(1);
SendBytes(servoNumber);
SendBytes(speed);
//Set posistion
SendBytes(sync);
SendBytes(deviceId);
SendBytes(2);
SendBytes(servoNumber);
SendBytes(servoPos);
}
private void SendBytes(byte data)
{
byte[] dataToSend = { data };
_serial.Write(dataToSend, 0, dataToSend.Length);
}
//Using it like this:
SerialServo.MoveTo2(0,254,80);
But i get a red LED lighting up, that means fatal error.
So i guess im sending something wrong…
Anyone who can understand what series of bytes i should send?