I want to have a physical button (not a software button) that I put into my custom rig. When I click this button, I want to receive a signal in my software e开发者_如何学C.g. by registering my callback function.
The goal is to have a panel of physical button that when click will perform certain tasks in the software. The interrupt (for lack of a better word) should be as low latency as possible.
What I have looked at so far:
- Arduino: Use an Arduino board that is connected via RS232 and manually do the soldering necessary to hook a button from RadioShack to it. (Too much hardware work for my skill/time availability)
- An Android application: Well not truly a hard button to click but it is a hardware. The Android app will communicate with my computer via Bluetooth. (I doubt the latency is good. But I would love to be proved wrong.)
A cross-platform solution is much appreciated.
- Targeted platforms: 64-bit Linux and Windows (in that order)
- Language: C++
Any idea what type of connection/device I should look into to achieve this?
You can use the device driver dev kit to write an hardware interrupt handling object
Connectivity wise - easiest way is a parrallel port - ideally a real one on a card not a USB adaptor, otherwise somethign like a an arduino talking to thePC as a serial port over the USB link is easiest.
Edit - for 50 buttons you will need some sort of keyboard matrix processing as well as a link to the PC. Go for an ardunio. There is a demo app of reading values from the Arduino's USB cable as a serial port/
How about this?
http://www.orin.com/access/swifty/
Teeny weeny size. Huge possibilities. Swifty is a speedy USB switch interface in an extremely compact design. Working with up to two wired switches, or three wirelessly through Beam™, this pint-sized powerhouse can output mouse clicks, joystick buttons or keyboard functions.
Or even customize an old serial or USB mouse if your rig doesn't otherwise use one. Or maybe even if it does :)
精彩评论