LCD_WIDTH

Using LCD_WIDTH:

This constant changes the width characteristics of a LCD display.    The standard width is assumed to be 20 characters.

This constant allows the width to be optimised for specific LCD chipsets.

Example

    #DEFINE LCD_WIDTH  16          ' <<< the constant this page documents

    Do
      CLS
      Locate 0, 0
      Print "1234567890123456"          'fills all 16 columns of a 16-character-wide LCD
      Wait 2 s
    Loop

Key line: #DEFINE LCD_WIDTH 16 — tells the LCD driver the display is 16 characters wide instead of the default 20, so commands such as Locate and word-wrap behaviour in Print stay within the physical bounds of the panel.

Define Required Connections

LCD_WIDTH

Default is 20
16 - Set the WIDTH 16 characters

If LCD_WIDTH is not defined, the WIDTH defaults to 20

See Also:

  • LCD_IO 4 — setting up a 4-bit character LCD connection
  • Locate — positioning the cursor within the display width set here
  • Print — printing text that wraps within the display width