Parallel-port LED driver

The LedActor sends a data byte out the parallel port (/dev/lp1) of the PC which VSS is running on. It is intended for sending to a particular homebrew circuit which sends 2+3+3 bits of brightness data to a red, green and blue LED respectively. It's been tested only under Linux as of 1/5/2000.

Don't create more than one LedActor; it wouldn't make sense, since you don't have more than one /dev/lp1.

To use the LedActor, load ledlpt.so and create an actor of type LedActor.

LedActor messages

In addition to the messages understood by all actors, the LedActor understands the following message:
SetBrightness hActor x
Scale the overall brightness to x: 0 is dark, 1 is full brightness.
SetHue hActor x
Set the hue to x. As x varies from 0 to 1, hue moves smoothly through six regions:
SetBlink hActor period dutycycle
Blink the LED. Alternate its current hue-and-saturation settings with darkness. A blink happens every period seconds, and the relative length of the lit portion compared to the length of the period is dutycycle (in the range 0 to 1).
So if dutycycle is 0, it stays dark no matter what the hue or brightness or period is. And if dutycycle is 1, it stays lit no matter what the period is.
If the period is 0 (the default), no blinking happens (the LED stays on). If the period is less than 0.05, it is rounded down to 0: blinking at faster than 20 Hz is doubtfully meaningful.

Examples

LoadDSO ledlpt.so;
rgb = Create LedActor;
Display a very bright green, followed by a faint purple-blue:

SetHue rgb 0.33;
SetBrightness rgb 1;
sleep 1;
SetHue rgb 0.79;
SetBrightness rgb 0.4;
sleep 1;