Name display
It is always nice to have a demo where the visitor can become active himself. For this reason we prepared a demo in which the visitor will type his name into a terminal window.
When pressing "enter" he will see the message on the 2 line LCD display:
The demonstration is based on an exercises on the
HD44780
After the Open Day the students told me that some visitors have asked why we cannot display names longer than 16 characters. It should be possible to show these names in a round robbing fashion. I answered, saying that this was entirely possible but would make the program substantially more complex.
To prove that my answer was right I tried to write this program, improvedNameDisplay and I attach the code to this page. The program uses pthreads to separate the round robbing task from the task waiting for new user input. In addition I must use non-blocking input from stdin (the terminal) to make sure that the program is not stuck waiting for user input but can do its task for the round robbing.
I tried the mechanisms first (creating and deleting a thread and the non-blocking I/O and I left these test programs in the archive for you to inspect. Finally I tried the round robbing display on the PC (I had no access to the Raspberry Pi during the weekend).
The resulting code is interesting because the Makefile finds out through the SESSION environment on which system it is running and configures the C code through #define VARIABLES which are passed to the code though the -DVARIABLE compilation option.
--
Uli Raich - 2017-10-06
Comments
Topic revision: r5 - 2017-11-12
- uli