News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

usb led's control

Started by gavin, March 09, 2006, 01:17:40 PM

Previous topic - Next topic

gavin

Hey a quick question guys.
I connected a usb cable to a led using the red and black wires.
Whats the easiest way to turn on and off the led ?

Obviously it's not as easy as the keyboard led's i did before :(

:U

Mark Jones

Gavin, you're way off. First, this question should be posted in the Orphanage, and will likely be moved there when a moderator encouters it.

To answer your question... you can't blink an LED from USB. There are four wires in a USB cable, two are power and two are data. The two data wires do not work like a switch, turning on and off. They can not power anything like an LED. To "blink an LED from USB" you'll need to:

1. Build a Windows WDM USB driver for the device in step 2.
2. Build a microcontroller or USB driver circuit connected to the USB bus. Chips like the Microchip PIC 18F2450 or other vendors can be used. (Well I suppose there is a possibility straight CMOS buffering might work in a pinch, but I can't say for certain.)
3. Extensive electronics engineering knowlege in order to design and implement the above.

It would be far easier to try blinking an LED from the parallel port, or even the serial port.

Regards,
Mark
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

P1

#2
Ok, I just have to ask, what are you building???

Because just blinking a LED is pointless, unless you plan to use it as something.

I have seen a project or two using USB between MASMforum and WIN32.MASM board.

BTW, he can wire the LED across the power wires and plug and unplug the cable.   :dazzled:  grunt, grunt, hit dirt with bone club.
BTW, BTW, I have seen portable laptop lights done this way.

Regards,  P1  :8)

skywalker

Quote from: gavin on March 09, 2006, 01:17:40 PM
Hey a quick question guys.
I connected a usb cable to a led using the red and black wires.
Whats the easiest way to turn on and off the led ?

Obviously it's not as easy as the keyboard led's i did before :(

:U


If you're just wanted something cool looking, I saw some USB cables in the 99 cents stores that are lighted
up all the time.




PBrennick

Yes, they have a stiff wire and at night I can turn out all the lights in the den and position the light so that it shines on my keyboard.  I just checked mine out and it is an LED. That is about it.  Happy typing!

EDIT:  BTW:  I am using a four port USB hub.

Paul
The GeneSys Project is available from:
The Repository or My crappy website