A serially controlled 16x2 LCD module.
A serial LCD text display allows characters and digits (plus a limited number of other characters) to be displayed on a number of lines. This is extremely useful for showing project status and other information.
Serial LCD
Schematic
PCB
Display a temperature
Reads the temperature from a DS18B20 and displays the result on the LCD
- Code Example:
-
low b.2 ; Initialise LCD output pause 500 ; Waif for LCD to initialise main: readtemp c.1, b0 ; Read DS18B20 on pin C.1 bintoascii b0, b1,b2,b3 ; Convert temperature to ascii digits serout b.2, n2400, ( 254, $80 ) ; First line of display serout b.2, n2400, ( "Temperature" ) ; Display "Temperature" serout b.2, n2400, ( 254, $C0 ) ; Second line of display serout b.2, n2400, ( b1, b2, b3, "C" ) ; Display the temperature pause 1000 ; Waif a second goto main ; Display latest temperature
Copy Code Submit an Example
Combined serout commands
It is sometimes convenient to show separate serout commands for program clarity, but at other times it may be be more convenient (and will usually use less program space) to combine multiple serout commands into one. The following example shows two subroutines, both will send the same output when called.
- Code Example:
-
Sub1: serout b.2, n2400, ( 254, $80 ) serout b.2, n2400, ( "Temperature" ) serout b.2, n2400, ( 254, $C0 ) serout b.2, n2400, ( b1, b2, b3, "C" ) return Sub2: serout b.2, n2400, ( 254, $80, "Temperature", 254, $C0, b1, b2, b3, "C" ) return
Copy Code Submit an Example
Create Module
The Serial LCD is connected via a 3 wire cable to the servo create module.
Bill of Materials
Description | Code | Qty | |
---|---|---|---|
Serial LCD Module | AXE033 | 1 | Buy Now |
3-pin 0.1" header | CON035 | 1 | Buy Now |
Simulation
Submit Your Own Code!
You must be logged in to submit code examples. Login now.
Share