Step 8Code
setleds -L -caps +scroll < /dev/tty0 ;sleep 3s ;setleds -L +caps -scroll < /dev/tty0; sleep 3; setleds -L </dev/tty0
breaking this down:
#To turn on the red lamp:
setleds -L -caps +scroll < /dev/tty0
#to turn on the green lamp:
setleds -L +caps -scroll < /dev/tty0
#to return to the state where the LEDs display the keyboard settings
setleds -L </dev/tty0
You can include these system calls in your own program, or use the a phython unit test module that Chris wrote based on the PyUnit unit testing framework built into python. Just unpack the files from the tar archive (tar -xzvf lava_unittest.tar.gz from a console) and try the following commands from a console:
python lava_unittest.py test_lava_unittest-pass
python lava_unittest.py test_lava_unittest-fail
or
python test_lava_unittest-pass.py
python test_lava_unittest-fail.py
To run from a terminal emulators, uncomment the warning-flagged lines and try running it
as root from a terminal emulator.
With this code, all one needs to do is swap instances of "unittest" with "lava_unittest" in Python scripts written for unit testing. No re-coding is necessary.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|












































