My son was recently given a Maplin robotic arm kit with USB interface by a neighbour of ours who had received it as an unwanted gift. Over the Xmas break I got a chance to help my son build it (it only took a couple of hours, and was reasonably straightforward). Once we’d built it, we tested it out using a laptop booted into Windows with the supplied Windows software. The Windows software is OK for manual control, but the “programming” software is really quite dire… Clearly, what is needed here is a way to drive it from a Python session running on the Raspberry Pi. It turns out to be very easy to do this.
First, get hold of PyUSB (version >= 1.0.0), and note that the version currently in the Raspbian repo is too old. Unpack PyUSB and build it in the usual python way using
sudo python setup.py install
Once you are ready to go, plug in the arm and switch it on. Use
to check that the Pi has detected the arm correctly.
I expected to have a bit of hassle figuring out how to drive the arm from python, but it turns out that very clear instructions for this arm are given in the article “Skutter: Part 2” in Issue 3 of the MagPi magazine, so just following those instructions gets the arm up and running in a few minutes. Very cool.