hello folks.
I’ve been struggeling with a code to put my servo into a new position and the final (and working) edition is the following code:
void setServoPos(libusb_device *device, int position, int servo)
{
libusb_device_handle *device_handle;
libusb_open(device, &device_handle);
libusb_control_transfer(device_handle, 0x40, REQUEST_SET_TARGET, position*4, servo, 0, 0, (ushort)5000);
libusb_close(device_handle);
}
Now this works very well, but I wanted to also be able to set the speed and the acceleration. I stated out with the speed like this:
void setServoSpeed(libusb_device *device, int speed, int servo)
{
libusb_device_handle *device_handle;
libusb_open(device, &device_handle);
libusb_control_transfer(device_handle, 0x40, COMMAND_SET_SPEED, speed, servo, 0, 0, (ushort)5000);
libusb_close(device_handle);
}
Now this dosn’t seem to work very well. And I cant tell why.
Any help on setting the speed with libusb is very welcome
I’m also looking for a solution on the “give feedback once the operation is finished” (aka GET_MOVING_STATE in scripting language)
my goal is to totally avoid the usbwrapper because I’m building a lightweight controller for my panorama camera. (servos for the x/y coordinates and usb-ptp for picture control)