You sparked my interest with your parallel port interests. I too have always wanted to get into building something that I could control from my computer but I have no electronics background. I decided to go pick up a breadboard, a handfull of LEDs, some wire and a DB25 connector. I built a cable to plug into my parallel port and wire up all the data pins and a ground to the breadboard. Stuck in 8 LEDs (Red, Green, and Yellow randomly).
Then I took the lptout.c example and an nsleep.c example (using usleep() to get the millisecond resolution) which gave the the necessary programs to include in a simple shell script to control the LEDs. I made the shell script so you could input the LED sequences interactively or put all of your LED commands in a file and loop through them to make cool christmas light patterns. My son made the light sequences. Here's the three pieces of code:
lptout.c:
nsleep.c
lights:
Then:
# gcc -O -o lptout lptout.c
# chmod u+s lptout
$ gcc -o nsleep nsleep.c
$ chmod +x lights
Then to run the lights program interactively:
$ ./lights
If you want to have the script read the value/delay sequences from a file run it like:
$ ./lights lights.txt
Here is the "lights.txt" file my son came up with:
Makes a good Christmas light sequence.
Thanks for sparking my interest. Now it's on to more interesting things like building a battle bot and writing a program to control it.. I am into R/C airplanes as well so I am trying to think of a way to use radio and computer control together.. Any ideas?
[ August 06, 2002: Message edited by: VoidMain ]