What I want to do: I want to display "Hello World" text on an LCD1602
How I tried to do it: I followed the "LCD Module Hello World" tutorial from the Elegoo Starter Kit Manual .
Manual Link -> Chapter 22 LCD Display
Equipment. : Elegoo MEGA2560 R3 Controller
1602 Module (came with the kit, cannot see the brand but I'll add the pics)
Kit Details Here
Problem: The text doesn't display, instead the black grids show up.
Note: LCD and backlight along with contrast setting with a potentiometer are working. It is just that the text is not showing up.
Connections :
LCD RS pin to digital pin 7
LCD Enable pin to digital pin 8
LCD D4 pin to digital pin 9
LCD D5 pin to digital pin 10
LCD D6 pin to digital pin 11
LCD D7 pin to digital pin 12
LCD R/W pin to ground
LCD VSS pin to ground
LCD VDD pin to 5V
10K resistor:
ends to +5V and ground
wiper to LCD VO pin
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup()
{
lcd.begin(16, 2);
lcd.print("hello, world!");
}
void loop(){}
This simple thing is driving me nuts for the past two days. Before I rant more, I'll share what I have tried before asking for help.
- Go through all the stuff mentioned here
- Make sure the circuit wiring is correct, connections are not loose and code is bug-free
After the above 2, I tried to debug this programmatically.
- I kept log statements in both setup and loop functions and both of them seem to get invoked appropriately
- I printed the return value of lcd.print("hello, world!") and it returns 13 which means the library is working as intended.
byte bytesWrittenFirstLine = lcd.print("hello, world!");
Serial.println(bytesWrittenFirstLine); => This prints 13
This is where I am stuck. Because I have no clue on how to debug this further.
I wanted to solve this myself and have spent a couple of days without any success. The fact that I am unable to run the default hello world sample is really frustrating.
The only thing I can think of is that somehow my data pins are messed up but again I am following the exact tutorial setup and not doing anything special. I hope I am not doing anything wrong with the potentiometer.
In what direction should I debug this further? And what tools do we have apart from the "Serial Printing" to debug electrical circuits? Newbie here would love to know all the available tools that make debugging easier.
Please LMK if any extra information is required.
Thanks in advance for unblocking me !!