Pololu Maestro 24ch using C Ubuntu

Hi !

My name is Benjamin and I’m working on an hexapod project for my French ingeener degree.
To control 20 servos, i use Maestro USB to get datas from an gyro system via UART and to give servo’s position (USB chained mode).
I don’t know if it’s possible to run an C program using libusb after opening command ports.
I want to ask you some help about sending commands to my Maestro 24CH, would you mind to send me several examples ?
I’m working and compiling under Linux Ubuntu 10.04 with -GCC.
Thanks and have a nice day !

Benjamin.

Hello.

There are many ways you could do what you want to do. If the Maestro serial protocol is compatible with your gyro system’s protocol, the simplest plan is to set the Maestro’s serial mode to USB Chained and write a program that sends and receives bytes on the Maestro’s virtual serial port (specifically the Command Port, which is usually /dev/ttyACM0). Sometimes it would send and receive bytes from the gyro, and sometimes it would send Set Target commands to the Maestro to control the servos.

One disadvantage of this plan is that the speed at which you can send commands to the Maestro’s servos will be limited by the baud rate you use to communicate with the gyro. If that is an issue, you can use USB Dual Port mode instead.

Here are three resources that can help you:

Here are some other potentially useful resources, if you want to use libusb:

I think it is possible to connect to the Maestro using libusb after you have opened one of the serial ports in Linux, but I’m not totally sure.

–David

Thanks a lot David !

I wished use C but C++ seems to be better for this part of my project.
Finaly it works !
I’m just looking for send and receive datas from Maestro’s UART !

Bonne journée !

Benjamin