LEDS(4)               OpenBSD Programmer's Manual (Sun3)               LEDS(4)

NAME
     leds - back-panel LEDs

DESCRIPTION
     The file /dev/leds is an interface to the diagnostic array of 8 light-
     emitting diodes on the back of the computer.

     This file contains two unsigned ints (in native byte order, as would be
     written by passing the address of an unsigned int to write(2), which on a
     Sun-3 means big-endian), followed by a string of bytes.  The string of
     bytes gives the successive patterns to be displayed on the LEDs; each
     byte's bits are taken and used to drive the LEDs.  A 0 bit illuminates
     the corresponding LED; a 1 bit leaves the corresponding LED dark.  The
     first unsigned int gives the number of clock ticks that are skipped after
     each pattern is loaded before the next is loaded.  For example, if this
     value is 0, a new pattern is loaded each clock tick; if it is 3, a new
     pattern will be loaded every fourth clock tick (i.e., three ticks will be
     skipped between loads).  The second unsigned int gives the number of pat-
     terns in the list, that is, the number of bytes following the two
     unsigned ints.

     There are limits on the two integer values; attempting a write that would
     cause either of them to take on too large a value causes the write to re-
     turn EIO without affecting anything.  The limits are compiled into the
     kernel; as of this writing, the first one can be at most 128, the second
     at most 10240.

EXAMPLES
     This example displays a single lit LED scrolling from one end of the dis-
     play to the other, over and over, moving every six clock ticks.  The
     first eight bytes supply the two unsigned ints mentioned above; the other
     eight specify the patterns.  (Convert them to binary, and remember that 0
     bits mean lit LEDs.)

           # echo 0 0 0 5 0 0 0 8 254 253 250 247 239 223 175 127 |
             awk '{ for (i=1;i<=NF;i++) printf("%c",$i+0); }' > /dev/leds

FILES
     /dev/leds

HISTORY
     /dev/leds appeared in post-2.0 OpenBSD.

OpenBSD 2.9                      March 2, 1996                               1
