问题
I have this USB Relay: http://www.ebay.com/itm/5V-USB-Relay-2-Channel-Programmable-Computer-Control-For-Smart-Home-/141097843081?pt=LH_DefaultDomain_0&hash=item20da163989 Al I need is to send close/open to the device (to turn on & off an LED light)
How can I do that using C# or C++?
Thanks Boaz
回答1:
Here's what you need (tested on Linux) :
- HIDAPI from http://www.signal11.us/oss/hidapi/
- USBRELAY from https://github.com/darrylb123/usbrelay/blob/master/README.md
Use it like :
- usbrelay ZG4HU_1=1
- usbrelay ZG4HU_1=0
to switch the first relay on and off. ZG4HU_2 addresses the second relay and without arguments you even get the relay status.
-- Hans
回答2:
The 26484 26483.rar is what I needed for Windows. .exe files for graphic and for command line for testing and .dll for my own development. Found here: http://files.elektroda.net/794975,26484++26483+usbrelayextlib.html
来源:https://stackoverflow.com/questions/22667304/usb-relay-commands