tags:

views:

522

answers:

4

Hi, How to access Digital I/O using USB using C or C++ or Vb.net Or C#.net?

+2  A: 

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.

MSalters
+1  A: 

You can find more information here: http://www.beyondlogic.org/

rtacconi
+1  A: 

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

David Sykes
A: 

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

Vitaly Dyatlov