I just bought a 5 volt dual relay module for my arduino. But now that I have it I was wondering if there is any way that I could control it directly from USB.
The pinout of the module is GND ONE TWO VOC This would make it really easy to just connect a USB cable to it.
Assuming I did that is there any way to send 5 volt through the USB Data+ and Data-?
Thank you
Answer
Basically, NO. USB is a complex protocol, and there is no direct way to control the D+ and D- lines (your ONE and TWO) from software. You can only cause the USB stack to send certain messages, embedded somewhere in a stream of other messages.
But you MIGHT be able to switch the power to the USB port (your GND and VOC)off and on under software control. Most laptops can do this in some power down mode, so there might be a way. Don't ask me how, I am not a PC guru. The catch will probably be that you switch the power to ALL USB ports, including your mouse and keyboard...
No comments:
Post a Comment