PDA

View Full Version : [Question(s)] Pololu USB 16-servo controller problem



bigd
08-25-2008, 09:44 AM
Hi,
has anyone had any success writing C code to communicate with the Pololu USB 16-servo controller or do you know where I can get a small test program for this unit. I am running a Linux 2.6 kernel which supports CP2102 and the driver sees it fine. Ive been working on some C code for about a week now but with no success. It appears that I am communicating with the controller, the Green rx LED will flash when sending data to it, but the servo's will not respond. I am not 100% sure that there's not a problem with the unit, thus any test code would be great to move the servo's back and forth.
Thanks for any help...

bigd
08-28-2008, 10:16 AM
Found the problem in my code, it works great, life is good.

Electricity
08-28-2008, 10:40 AM
Would you mind sharing your code? I picked one of those up myself, and I can't for the life of me figure out how to communicate with it.

bigd
08-28-2008, 08:19 PM
sure will,
Its just a small test program written in C you run from the command line. It will show the basic stuff you need to do to control the servo's and you can take those functions() and expand on that to do your own thing.
I need another day or so to finish the keyboard interaction to move the servo's back and forth and also kinda clean up code too. I am trying to write the code as ANSI as possible so both Unix and Windows users can do something with it. I will send you a message as soon as I post it to let you know.

Adrenalynn
08-28-2008, 09:29 PM
I'm about to post a drain-bed level tutorial on controlling a servo with the SSC-32 (I believe the Pololu will take the same commands, but regardless it shows how to talk to a com-port) tutorial in C#. Another half hour or so and it'll be up. Just as a heads-up on the subject...

Adrenalynn
08-28-2008, 10:05 PM
Tutorial's up...

BigD, how about posting your code and we can help you debug it?

Electricity
08-29-2008, 05:27 PM
Cool guys, thanks!

bigd
08-29-2008, 05:53 PM
Hi Adrenalynn,
thanks for your input, sorry it took so long to get back to you but had a busy day. I got a chance to look at your post and your functions sure make it look easy. Im not a MS WIndows user and what I am trying to do is contribute some ANSI C code portable to all platforms. My goal is to make it so that it will compile on any C compiler. There's nothing fancy about the program, its just a command line tester, but I hope it will help others. As this program progresses, I will probably write the GUI stuff in Tcl/Tk which is also platform compatable. After Googling the crap out of the NET, there was nothing for us UNIX guys/gals so that got me more motivated. I hope to post it tomorrow and thanks again for your input.

Adrenalynn
08-29-2008, 07:18 PM
Thanks for your kind words - but I've been programming under the Unices a lot longer than Winders. :) So like I say, if you have any questions - there's a solid handful of programmers here.

BTW, mine's command-line-based too. ;) No Winders in dem winders. :)

Looking forward to seeing what you come up with!

bigd
09-11-2008, 07:57 PM
well, better late then never, just been busy at work.
Here's the first run, I tried to keep it as a simple C program and it doesn't fully have all of the error checking for inputing data that I wanted to put in it but just be sure to put a value in before pressing enter. I still need to make some kinda timer/buffer for sending multiple commands, this controller wont buffer a string of commands but thats still work in progress. This program is just a text base user interface, sorry it's not a pretty GUI. maybe later..not!
Try it out, any questions/problems, please let me know.
I couldn't attach a .c file to this email, so just rename the file without the .txt extension.