FreeLCD is a collection of applications for gathering and displaying information on liquid crystal displays. It consists of a server with one or more device drivers, and several clients that provide information to the server. These clients do not have to know the dimension, the type (character based or graphical), or the number of the connected LCDs; all information is passed in a device-independant XML format.
We start with making a list of all connected devices. For this demo, a CrystalFontz 634 display is connected to the serial port. Here's a snippet from the configuration file:
<output name="display1"> <driver name="cfontz"> <width>20</width> <height>4</height> <firmware>1.3</firmware> </driver> <backend name="serial"> <device>/dev/ttyS0</device> <baudrate>9600</baudrate> </backend> </output>
The server will look for cfontz.so (or cfontz.dll) and load it. The serial port is configured separately; other drivers may also use the serial port, or maybe you have a 634 display that is connected to a USB or I2C bus.
The display will remain empty, until a client tells it to show something. Since all data is sent as XML, you can use generic tools like telnet or netcat for this purpose. First, we define a screen:
<screen name="firstscreen"> <layout> <row> <col> <field name="first" type="scalar" align="left" /> <field name="second" type="text" /> <field name="third" type="scalar" /> </col> <field type="text" name="fourth" /> </row> </layout> </screen>
The layout of "firstscreen" contains one row of elements, consisting of one column and a field named "fourth". Inside the column, there are three more fields. Now that the layout has been defined, we can send some content to put in the fields:
<data name="firstscreen"> <value name="first">42</value> <value name="second"><text>€</text></value> <value name="third">667</value> </data>
Note that the second field contains a Euro sign. Clients are supposed to send their information in UTF-8, so this character is encoded as 0xe2 0x82 0xac. Displaying this character on a graphical display is no problem (as long as the truetype font has the corresponding glyph), but for alphanumeric displays the driver has to map it to something that is supported by the device. The 634 has a small number of glyphs in ROM, and eight of them can be redefined at any given time. The cfontz driver will upload a Euro glyph to one of the free slots, and display it. If all eight slots are already taken, it will use an 'E' instead.
Here's the final result:
New: I have also added a crash course in writing a clock in Python.
Drivers are available for the following displays:
Also, any driver can make use of one of the following backends:
It has been confirmed that FreeLCD builds successfully on the following platforms:
I can only test the functionality properly on GNU/Linux and Win32 myself.
FreeLCD can be found on http://savannah.nongnu.org/files/?group=flcd. Because there seems to be a problem with uploading files recently, I have put up version 0.3 and its signature here:
After unzipping the sources, cd into the directory and type:
You can use the --foreground switch to prevent the daemon from forking into the background. This way, it's easier to stop it, and you can also use the curses backend.
You can obtain the bleeding-edge version from CVS:
cvs -d:pserver:firstname.lastname@example.org:/cvsroot/flcd login
Just press enter when asked for a password.
cvs -z3 -d:pserver:email@example.com:/cvsroot/flcd co -P flcd
Code documentation can be generated with Doxygen. It can also be viewed online, but it is not guaranteed to be up-to-date with the latest version in CVS.
FreeLCD depends on the following libraries:
The following milestones are planned:
More free LCD software:
LCD manufacturers and hardware sites:
Return to GNU's home page.
Please send FSF & GNU inquiries & questions to firstname.lastname@example.org. There are also other ways to contact the FSF.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
Updated: $Date: 2004/06/23 19:17:16 $ $Author: unicorn $