Previous Topic

Next Topic

Book Contents

Book Index

OBLCD: Examples

The mechanics of programming the LCD are quite simple. There are 4 basic steps:

  1. initialize the LCD
  2. Position the cursor
  3. Display text
  4. Display numbers

The key to success is careful planning; planning of exactly what you will display and planning of exactly where it will be displayed and how much space it will take.

One useful planning tool is to type up intended displays on your computer using a mono-spaced font like Courier New or Fixed Sys, for example:

0123456789012345 (ruler line)
Temp = 34.5°C OK
Press=12.3kPa Hi

Here the top line is used as a ruler, showing column numbers for a 16 character line. You can see I had to sacrifice the spaces before and after the equals sign in the pressure display, in order to fit in the status indicator.

The following pages provide some worked code examples for various situations.

In This Section

Example: Simple text display with OBLCD

Example: Integer count display with OBLCD

Example: Temperature readout with limits with OBLCD

Example: A simple menu system with OBLCD

Example: Bargraph on OBLCD

Example: LCD backlight auto-off timers