Thursday, April 03, 2008

Computer Dashboard, part 2 - USB


back to Part 1

So, now that I had the meters and blinkenlights which would form the display, it was time to think about how the information was going to get from the computer to the display. I decided to start with the simplest case - how would I turn an LED on and off? To turn an LED on, you need a source of voltage.

The parallel or printer port used to be the tool of choice for doing this. You get multiple pins, each of which can be assigned to be either on (voltage) or off (no voltage), and there are multiple drivers which can help you set these pins from your software. However, the parallel port and its cousin, the serial port, are rapidly disappearing, replaced by the USB port.

As I found out, USB communication is not accomplished with a chip or two from Radio Shack. You actually need a license, which you must buy, in order to talk to the port, and talking to the port more or less requires a microcontroller on the other end. So it didn't look as though I was going to build one from scratch.

Fortunately, several companies sell boards that will plug into a USB port, and offer that same, tinkerer-friendly set of pins which can be assigned to on or off. The one I chose was from ActiveWire.

Once I got the board, I plugged it in, wired up an LED to one of the pins, and used the sample application that came with the board to turn the LED on and off. Success! Now I would have to figure out how to control multiple LEDs, and some way of controlling the meters.

No comments: