1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Connecting to USB

Discussion in 'Mac Programming' started by purplelizzard, Feb 24, 2007.

  1. macrumors newbie

    #1
    Is there anyway to send data directly to a USB port? What I want to do is have a USB cable hooked up to a USB port and hook up a transistor or something like that to the cables coming out of it and write a program to turn the transistor on or off.

    If this isn't possible with USB, what can I use to do this?
     
  2. macrumors member

    #2
    It is possible sending data to a USB port using IOKit. But your receiver also needs a USB controller, you can't communicate directly with a transistor. A solution would be a USB microcontroller using it's digital io ports. I have done this, and it works.

    Wittegijt
     
  3. macrumors newbie

    #3
    Where can I get one and how do I do that? Also, is it possible to use FireWire or Ethernet instead? I suspect FireWire is the same as USB, but what about Ethernet?

    thanks
     
  4. SMM
    macrumors 65816

    SMM

    #4
    You did not specify exactly what your application is, but you might find this site useful.

    http://www.nxp.com/
     
  5. macrumors member

    #5
    You are looking for something like this http://www.devasys.com/usbi2cio.htm. You can find cheaper solutions, I bought mine for €12. The documentation is usually for windows, but it is not that difficult to figure out. There are also kits for FireWire and ethernet, you can use all three (I have used only USB). Sample code is in /Developer/Examples/IOKit/usb if you have installed the developers tools.

    Wittegijt
     

Share This Page