Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Hey, so I'm just playing around with a usb cable and an LED. I plugged in the usb to my computer and connected ground with the LED ground and the last usb pin (+) to the LED.

It stays lit bright. I moved the wire from the usb power pin to the D+ pin. Is it possible that I could send a bit stream through usb that would in turn light up this LED?

I'm not even a beginner with usb, drivers, etc. I just had the idea that hit me and wanted to see if it was possible as a sort of show off to friends.

share|improve this question
    
You should perhaps ask this on electronics.stackexchange.com although they'll no doubt tell you need something more sophisticated than this to work. –  JohnB May 26 '12 at 17:00

3 Answers 3

up vote 6 down vote accepted

Not directly, and even if you could, it wouldn't be very useful since the usb protocol constantly sends pings over the wire; the led would probably appear continuously dimly lit.

If you wanted, you could make a low-pass amplifier to get it done. If you go this route, check out USB In A Nutshell to learn more about the USB protocol.

share|improve this answer
    
Thanks a lot Shawn! I'll take a look through that book. –  kisplit Dec 25 '10 at 21:46

Another alternative might be a usb-serial or usb-parrallel port dongle.

Note you will need a resistor in series with your LED to limit the current to suitible amount to avoid burning out something (either the LED or the interface).

Another option is, there are off the shelf devices available that do something like what you ask, e.g. at time of writing 'googling' "usb gpio" produced many links.

share|improve this answer

If you have an old-style parallel or serial port, this is much easier.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.