Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lynkynpark86

macrumors 6502
Original poster
I just finished making a usb-powered light. I can plug it in and it will turn on, and obviously vise versa. But instead of a physical switch, I want a software switch. If there any way I can turn the light on/off with software? A python/ruby/applescript/etc script would be preferred, but any other way you know how to do this would be GREAT!
 
As far as I know the 5V that run to the USB ports are consistent. I doubt you can turn on and off the voltage to a port. My guess is you would have to have some hardware in your light gizmo that the computer and light can communicate. That is above my knowledge.
 
Google search terms:
arduino usb
usb led controller


Another alternative is to buy a cheap USB to RS232 adapter (also called USB to Serial Port adapter), download and install the serial drivers (probably an FTDI or Prolific PL2303 chip in the adapter), then wire up one of the serial-port handshake outputs to drive an LED. For software, get AMSerialPort.

It all depends on what your goals are: learning electronics, learning serial-port interfacing, learning electronics, not learning much other than how to turn an LED on/off, etc.
 
Last edited:
This is not trivial. You need to get into building some hardware to do it. Depending on your experience with things like this, it may or may not be feasible.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.