USB relay commands

痴心易碎 提交于 2019-12-07 13:55:40

问题


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

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