Can anybody point me to the correct library of LiquidCrystal_I2C for STM32 BluePill?
The library of STM32 only includes the LiquidCrystal but not LiquidCrystal_I2c.
// somehow, this part is needed this to make it print #include <SoftWire.h>
SoftWire Swire(PB6,PB7,SOFT_STANDARD);
// Check the address via I2C Scanner
LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup() {
// put your setup code here, to run once:
Wire.begin();
Wire.beginTransmission(0x27);
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setBacklight(255);
lcd.home();
lcd.clear();
lcd.print("Hello World!");
lcd.noBlink();
lcd.noCursor();
delay(1000);
}
thanks for the response. after running the scanner, i changed the address to 0x27. Right now, i know that
i am transmitting something to the LCD because its blinking in 1sec interval as declared in the code. it just doesnt print the actual string.
The link you provided in your orginal copy of the first post was an article that had instructions for building a PCF8564 I2C board to drive the LCD display, which you now appear not to have been following.
If your using the ready built board you have since added in the edit, then these are normally either at address 0x27 or 0x3F.
There is an i2C library for those displays that works out the connections between the PCF8563 and the actual LCD display, these have been known to vary.
Is the STM32 BluePill 5v tolerant on the i2c signals?
If not, you will need to use a level shifter.
The hd44780 library should work with the LCD & backpack.
It provides LiquidCrystal and LCD API 1.0 compatibility.
It can auto locate the i2c address and auto discover the pin mapping.
Other libraries hard code the pin mappings for a specific pin mapping and if your backpack is different, it will not work
It is also faster than all the other libraries.
While I have not tried it yet on the STM32 (I don't have any of those boards),
The library should work on it, and if for some reason it doesn't, I'd like work with you to fix it.
It is available in the IDE library manager.
Install it, I would highly recommend that you take a bit of time to read the included documentation (available in the Documentation sketch).
The i/o class for that device is hd44780_I2Cexp
First run the included I2CexpDiag sketch to verify that everything is working.
Then you can have a look at the other included hd44780_I2Xexp i/o class examples.
Here is a link to the github project page, which you can also find in the included Documentation.