I’ve been struggling to get an LCD display working. My previous attempt was:
So I traded that in for this:
Gravity:I2C LCD1602 Arduino LCD Display module
because it has everything included in the module to make life simpler! Problem was, that even with this simple component connected I still couldn’t get anything to display. What am I missing I thought?
I just worked out why I couldn’t get any of the displays running! Basically, the solution was I needed to ground the controller chip to the same ground as the external power supply I was using to power the display. Simple eh?
This is what I did to get the Gravity DFRobot display working.
This module has the I2C built in a 4pins:
Basically just power and SCL and SDA.
I connected everything up. The module I have is a LCD1602 V1.1.
I added the following library to my project:
thus, in my code I added:
#include “DFRobot_RGBLCD1602.h”
according to the example file, because my module is v1.1 the RGBAddr is 0x6B. Thus, to set up the module I do:
DFRobot_RGBLCD1602 lcd(/*RGBAddr*/0x6B ,/*lcdCols*/16,/*lcdRows*/2);
which initialises an object at address 0x6B with 16 columns and 2 rows.
I then initialise the module via:
lcd.init();
and then send it a message:
lcd.print(“Hello World!”);
that is basically all the code does. It compiles and uploads top both the Huzzah ESP8266 and the ESP32-S2 WROOM but I get nothing on the display, UNTIL I connected the GND from the controller (i.e Huzzah ESP8266 and the ESP32-S2 WROOM) to the same GND as the external battery pack I was using to power the display. The controller chips get their power from the USB cable at this stage.
Once that was done I finally saw:
There is nothing like the feeling off finally getting something working!
So the key learning here was link the GND between the external power supply and the controller chip.
