170 •
Application Examples
LED Indication Example
WAGO-I/O-SYSTEM
750
Linux Fieldbus Coupler
For every LED there is one definition for red and one for green. Each of the
three LEDs can be regarded as two separate LEDs. If, for example, the user
LED is switched to RED (on) and at the same time switched to GREEN (on),
it lights orange-green. The combination RED (on) and GREEN-BLINKING is
also possible and results in a user LED that blinks rot, orange-green.
The header file also contains the
ledman_cmd
macro which imlements the
access to the kernel driver. Every time the driver is called,
/dev/ledman
is
opened, written to and closed again.
Source code description: leds.c
The
leds.c
file contains the main() function. The console entries are analyzed
and the
ledman_cmd()
macro (which is defined in
leds.h
) with its parameter
values is called. The help text for the option "-help" is also defined here.