Originally posted by: DarkForceRising
The device is actually one of the Dreamcheeky USB driven Nerf Guns you can get online. It has several servos that spin the gun right and left as well as tilt it up and down. It's set up as a HID device, it does not have its own operating system, to my knowledge, and I have the product/vendorIDs. There are several open source programs that interface with this specific device, so I know the different values that are used for commands as well as return values. My problem is that none of the open source programs are in C++ on Windows.
I have a program based off of the Visual C++ 6 program on this site:
http://www.lvr.com/hidpage.htm . I've modified the program (it's based around a gui) to be usable in a console type application. I can currently get the modified program to connect and send commands to the nerf gun. I cannot get the program to read values from the gun. Say I send the gun a 'go right' command. It will keep going right until I send 'stop.' For the most part, the gun returns a default value when it's in the middle of moving or not doing anything. Whenever the gun gets to the bounds of it's movement, the servos start grinding and it returns a special value (when queried) signifying that it can't go any further.
As I understand it, with the HID interface I can send commands and get reports from the device. But I actually have to manually tell it to send a command or try to read a report. Which means even if the device hits physical bounds, I have to request a report to see if it's returning one of the special values. What I'd like is to tell it to move right, and then when it's at full right, read an input report. I'd prefer for the program not to have to sit their polling for a report, thus me asking about an interrupt.
Is this any clearer at all?