问题
How to access Digital I/O using USB using C or C++ or Vb.net Or C#.net?
回答1:
I use the Velleman K8055 USB EXPERIMENT INTERFACE BOARD
It is simple to program for, and has several inputs and outputs
I got one from Maplin for less than £30
回答2:
Easiest solution is possibly a USB-to-RS232 convertor. They're cheap commodity products, supported on most OS'es, and trivial to access as SerialPort objects. The physical side is a simple 5V, low-speed, low pincount interface suitable for both input and output.
回答3:
You can find more information here: http://www.beyondlogic.org/
回答4:
If you want to write/read directly to/from USB device, in Windows you can easily use function CreateFile with param lpFileName as special device name. Example:
HANDLE hFile = CreateFile(
"\\\\.\\X:", //X - is your USB device letter
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ, //for example READ
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
Next you can work with your device as with normal file. More information here
来源:https://stackoverflow.com/questions/1345425/how-to-access-digital-i-o-using-usb