LCD - startup problem
Posted: Tue May 17, 2022 8:34 am
Hi everyone, I've been trying for a few days now to try to run the LCD on the stm32f401 but to no avail. The LCD display is: LCD 2004A 4x20 HD44780 green. I connected the PB6 (SCL1) and PB7 (SDA1) + 5V and GND cables.
After connecting only the power supply, I adjusted the display so that there were two white lines visible.
After uploading the code below, the display is practically dim. In the upper left corner I have a small letter "o" and the cursor is blinking in the lower right corner.
I do not know what I am doing wrong, did someone have such a problem ??
Thank you in advance for your help.
After connecting only the power supply, I adjusted the display so that there were two white lines visible.
After uploading the code below, the display is practically dim. In the upper left corner I have a small letter "o" and the cursor is blinking in the lower right corner.
I do not know what I am doing wrong, did someone have such a problem ??
Thank you in advance for your help.
Code: Select all
#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Clcd.h> // i2c LCD i/o class header
const int i2c_addr = 0x27;
hd44780_I2Clcd lcd(i2c_addr); // use device at this address
// LCD geometry
const int LCD_COLS = 20;
const int LCD_ROWS = 4;
void setup()
{
int status;
// initialize LCD with number of columns and rows:
// hd44780 returns a status from begin() that can be used
// to determine if initalization failed.
// the actual status codes are defined in <hd44780.h>
// See the values RV_XXXX
//
// looking at the return status from begin() is optional
// it is being done here to provide feedback should there be an issue
//
status = lcd.begin(LCD_COLS, LCD_ROWS);
// Print a message to the LCD
lcd.print("Hello, World!");
}
void loop() {}