Hi dears :wave:
How can I control turning on/off my LED light connected to PC (by VB 6.0), I want to turn on/off automatically in different times.
Attachment 149797
Printable View
Hi dears :wave:
How can I control turning on/off my LED light connected to PC (by VB 6.0), I want to turn on/off automatically in different times.
Attachment 149797
Looks like it's plugged into a USB port. So, you'd need to know what port it's plugged into and turn the power to it on/off.
-tg
This is probably a lost cause.
Even though many hub chipsets support per port power switching most laptops are likely to have cheaped out to save on cost and space and omitted the outboard MOSFETs to do the actual switching, and instead hard wire ports to a 5v rail.
Even when that isn't true, most newer laptops have newer hub chipsets designed to manage the use of ports for USB-sourced external device charging. As a result power management hardware and software probably has control, making it very difficult or impossible to switch the power on and off from an application.
Yep. It's a tricky one this. Have tried it some time ago and this is what I have found:
Use a USB stick in the same usb port. Windows will pick it up and give it a drive letter.
You can then eject the drive letter.
BUT
Plug a light in the same usb port, and windows does not give a drive letter as it's not a drive.
...it does not work. There must be another way to do it... :(
Thank you for your trick ...
That's because USB LED lights have no brains in them. There's no chip in those lamps that communicate with the PC. They're not a USB HID. The only circuitry in those lamps are the LED, and either an LM317 constant current source or just a simple series wired current limiting resistor. These components are connected to the USB +5V and Common pin. The data pins aren't connected to anything. As far as the PC's OS is concerned there's nothing plugged into the port the LED is using.
All is not lost though. If you have elementary electronics skills you can use a USB/RS232 converter and control the LED using VB's MSCommControl. Most USB/RS232 converters employ the Prolific UART chipset. Prolific also offers a direct USB/TTL (CP2102) chip/module. Clones can be had on ebay for <$3.00.
http://www.ebay.com/itm/130683943875
With one of these puppies you could even write code in the MSCommControl to (PWM) the LED which would provide dimming control.
On my electronics forum (ElectronicsPoint) we had a recent discussion on what keeps RS232 alive and well at this late date. Your LED project is a good example of why it's still popular. Same for embedded programming.
Cheers!
Chris