USB中继命令 [英] USB relay commands
问题描述
我有这个USB中继: http://www.ebay.com/itm/5V-USB-Relay-2-Channel-Programmable-Computer-Control-For-Smart-Home-/141097843081?pt=LH_DefaultDomain_0&hash=item20da163989 我需要发送的信号是打开/关闭设备(打开和关闭LED灯)
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)
如何使用C#或C ++做到这一点?
How can I do that using C# or C++?
谢谢 波阿斯
推荐答案
这就是您需要的(在Linux上经过测试):
Here's what you need (tested on Linux) :
-
来自 http://www.signal11.us/oss/hidapi/的
- HIDAPI 来自 https://github.com/darrylb123/usbrelay/blob/的
- USBRELAY master/README.md
- HIDAPI from http://www.signal11.us/oss/hidapi/
- USBRELAY from https://github.com/darrylb123/usbrelay/blob/master/README.md
像这样使用它:
- usbrelay ZG4HU_1 = 1
- usbrelay ZG4HU_1 = 0
打开和关闭第一个继电器. ZG4HU_2寻址第二个继电器,没有参数,您甚至可以获取继电器状态.
to switch the first relay on and off. ZG4HU_2 addresses the second relay and without arguments you even get the relay status.
-汉斯
这篇关于USB中继命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!