Another device that can be controlled in a similar manner is the OWI Robotic Arm with a USB interface:
The OWI Robotic Arm with a USB interface (image courtesy of Chris Stagg)
This has featured in The MagPi magazine several times, thanks to Stephen Richards's
articles on Skutter; the USB control has been explained in detail in issue 3 (page 14)
at https://issuu.com/themagpi/docs/the_magpi_issue_3_final/14. It can also be found at https://www.raspberrypi.org/magpi/issues/3/.
The robotic arm can be controlled using the following class. Remember that you will also need to adjust the commands, UP, DOWN, and so on, when calling the move() function, as shown in the following code:
class OwiArm(): idVendor=0x1267 idProduct=0x0000 idName="Owi Robot Arm" # Protocol control bytes bmRequestType=0x40 bmRequest=0x06 wValue=0x0100 wIndex=0x00 # Protocol command bytes BASE_CCW = [0x00,0x01,0x00] BASE_CW = [0x00,0x02,0x00] SHOLDER_UP = [0x40,0x00,0x00] SHOLDER_DWN = [0x80,0x00,0x00] ELBOW_UP = [0x10,0x00,0x00] ELBOW_DWN = [0x20,0x00,0x00] WRIST_UP = [0x04,0x00,0x00] WRIST_DOWN = [0x08,0x00,0x00] GRIP_OPEN = [0x02,0x00,0x00] GRIP_CLOSE = [0x01,0x00,0x00] LIGHT_ON = [0x00,0x00,0x01] LIGHT_OFF = [0x00,0x00,0x00] STOP = [0x00,0x00,0x00]