How to access Digital I/O using USB

我的未来我决定 提交于 2019-12-08 10:34:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!