Tags:
create new tag
view all tags

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.

nameDisplayWindow.png

When pressing "enter" he will see the message on the 2 line LCD display:

nameDisplay.png

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 attachments
I Attachment History Action SizeSorted ascending Date Who Comment
Unknown file formatgz nameDisplay-v2.tar.gz r1 manage 32.1 K 2017-11-12 - 10:03 UnknownUser  
PNGpng nameDisplayWindow.png r1 manage 33.2 K 2017-10-06 - 16:27 UnknownUser  
PNGpng nameDisplay.png r1 manage 884.1 K 2017-10-09 - 12:13 UnknownUser  
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2017-11-12 - uli
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback