Problem backlight on with LCD 20x4 with I2C PCF8574 module attached


I have a Nucleo-F411RE with an LCD 20x4 display with blue light background. I previously tested the module with STM32CubeIDE and it works pretty great.

I am trying to make it work with Mbed with the TextLCD library and after doing some debugging with the config files I was able to make it work but I still have a problem: The backlight is not turning ON. I can barely see the characters printed in the module but since the backlight is OFF it is difficult to check the outputs.

So my question is… How can I control this? Where I need to set up to turn on the backlight again? Is it possible that I still need to look for the proper setup for my display in the library? This is my configuration:

//Select Serial Port Expander Hardware module (one option only)
#define DEFAULT        0
#define ADAFRUIT       0
#define DFROBOT        1
#define LCM1602        0
#define YWROBOT        0
#define GYLCD          0
#define MJKDZ          0
#define SYDZ           0
#define WIDEHK         0
#define LCDPLUG        0

I hope to get some good suggestion from you guys!

#include "mbed.h"
#include "TextLCD.h"
// Host PC Communication channels
Serial pc(USBTX, USBRX); // tx, rx
// I2C Communication
I2C i2c_lcd(PB_9,PB_8); // SDA, SCL
TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD20x4); // I2C bus, PCF8574 Slaveaddress, LCD Type

int main() {

Nevermind, I’ve found this and I solved the problem!