Code: Select all
dev.ctrl_transfer(0x0, 9, 0,0,[0x0,0xFF,0xFF,0xFF,0xFF])
Glad it helped and thanks for detailing the solution. I only used the Buzz as input sensors and, having a few other sets I have been meaning to put to similar use, it is very useful to have four outputs as well.kelle62819 wrote:Thank you for the above article, it helped me in figuring this out and I've learned a ton about USB in the process.
kelle62819 wrote:Well, I ran into a lot of issues with Pyusb. I was able to write programs that played with the lights on the controllers without problem and others that used the buttons as inputs without trouble but when I started switching back and forth between inputs and outputs I ran into a lot of errors (pipe errors, entity not found, etc)
I ended up stepping up a layer, losing Pyusb and communicating with the HID device driver. The default HID driver recognizes the Buzz! controllers as a 20 button joystick and is usable as such. I ended up using the cython-hidapi library (https://github.com/gbishop/cython-hidapi) that is a python wrapper for the C HIDAPI library. It took a little googling to get it to compile on the Rasp. Pi but I was able to get it to work and it is much more stable than going at the USB protocol directly. I have updated the cython-hidapicode to support multiple identical devices and the author (Gary Bishop) incorporated my code into the main codeline.
I think for people trying to get two-way communication to controllers, gamepads, etc. working with python, this is a great option.