Does anyone at Pololu have a C/C++ code sample for using the Set Multiple Targets command with libusb_control_transfer? I am trying to use it to no avail. I have a Mini Maestro 12. I’ve seen a few other threads on here about this (including Set Multiple targets via usb (libusb_submit_transfer)), but I can’t seem to get it working. Also, the Usc code provided by Pololu does not give any examples of commands that have an extended dataset such as this.
libusb_control_transfer provided by libusb can be used to access the Maestro’s native USB interface. That interface does not support a command for setting multiple targets at the same time. I suggest that you try using the regular Set Target command of the native USB interface in order to control your servos. This command only sets the target of one servo, but you can send the command multiple times. Since USB communication is usually pretty fast compared to the time it takes to move a servo, this method might be fast enough for you.
The Maestro’s serial interface, which is different from the native USB interface, does have a “Set Multiple Targets” command. However, if you already are using the Maestro’s native USB interface then I would not recommend switching to the serial interface unless there is a good reason.
Great. Thanks for your reply. A follow up question: How fast is that command over USB? Do you have any metrics on that?
Each Set Target command will probably take one or two milliseconds, and most of that is just because of the overhead of having a multi-tasking operating system.