View Single Post
  #3   Spotlight this post!  
Unread 05-05-2006, 10:23
jpflorido jpflorido is offline
Registered User
no team
 
Join Date: May 2006
Location: Spain
Posts: 3
jpflorido is an unknown quantity at this point
Unhappy Re: Servos don't work

Thanks Mike,

I'm using Visual Studio 2005 on Windows XP. The code is written in C#, but I also have tried with the GUI that the camera brought in Java and the servos didn't work either...

Here is the code I used:

// Set the COM1 serial port
SerialPort port = new SerialPort("COM1", 115200, Parity.None, 8, StopBits.One);

// Infinite ReadTime Out (default)
port.ReadBufferSize = 100000; // Size of the buffer: 100000 bytes
port.Open();
port.DiscardInBuffer(); // To empty the buffer


/* PART 1*/
port.Write("\r"); // Send command \r
while (((char)port.ReadByte()).Equals(':') == false) ;
// ':' received

/* PART 2*/
port.Write("SV 0 130\r"); // Send command SV to servo 0 at position 130
while (((char)port.ReadByte()).Equals(':') == false) ;
// ':' received


And for these two commands I received ACK....but the servos don't move!!!

Any tip...would be great.

Thanks again,
Javier.