Software-hardware question

Discussion in 'Mac Programming' started by lynkynpark86, Oct 12, 2011.

  1. lynkynpark86 macrumors 6502

    #1
    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!
     
  2. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #2
    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.
     
  3. chown33, Oct 12, 2011
    Last edited: Oct 12, 2011

    chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #3
    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.
     
  4. SidBala macrumors 6502a

    Joined:
    Jun 27, 2010
    #4
    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.
     

Share This Page