Skip to content

PCF8574 I2C adapter driven 16x2 LCD needs additional logic to turn backlight on #31

Description

@W7STF

Found when attempting to apply the Robaol patches to the original code for a non-RGB display, 16x2 I2C LCD attached to a PCF8574 adapter, specifically this white on blue LCD from Amazon:
https://www.amazon.com/dp/B0BWTFN9WF?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1

The backlight was not energized, so added the following in DSPham.ino

In DSPham.ino:
load_colour(); //load lcd screen colour.

//stf mod 2/16/2025 turn the backlight of the display I'm using on
#ifdef USE_MATHERTEL_LCD
lcd.setBacklight(HIGH);
#endif

morseInit()

Also noted that in the file lcd.h, for a 16x2 display, had to change the defines for LCD_ROWS and LCD_COLS from 4 and 20, to 2 and 16 respectively:
#ifdef USE_MATHERTEL_LCD
#include "LiquidCrystal_PCF8574.h"
#define LcdType LiquidCrystal_PCF8574
#define LCD_ROWS (2) //stf if the display had 4 rows of 20 characters these would be 4 and 20 respectively
#define LCD_COLS (16)
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions