sorry for the inconvenience but I just can't drive a common 16x2 LCD (the one we can find on the web for a few euros).
The interface is I2C and the board in use is the F401RE.
Although the I2C scanner correctly detects the hardware address of the LCD (0x27) and although the backlight/nobackLight command of the library in use works, I just can't write a test.
The simple example I'm using is this one:
Code: Select all
#include <LCD_I2C.h>
#include <Wire.h>
LCD_I2C lcd(0x27, 16, 2); // Default address of most PCF8574 modules, change according
#define PIN_SDA PC_9
#define PIN_SCL PA_8
void setup()
{
Wire.setSDA(PIN_SDA);
Wire.setSCL(PIN_SCL);
//Wire.begin();
lcd.begin(); // If you are using more I2C devices using the Wire library use lcd.begin(false)
// this stop the library(LCD_I2C) from calling Wire.begin()
lcd.backlight();
}
void loop()
{
lcd.print(" Hello"); // You can make spaces using well... spaces
delay(5000);
lcd.noBacklight();
lcd.clear();
delay(1000);
lcd.backlight();
}
I connected the SDA/SCL pins to two 100Kohm pullup resistors with the +5V power supply of the LCD (taken from the Nucleo).
I'm desperate because I can't understand where I'm going wrong. Suggestions?
thank you all so much for the help!