Finally managed to figure it out, after digging through the examples from the manufacturer's website (most of their code didn't work, or was for a different model display):
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // Define I2C Address where the PCF8574A is
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
void setup()
{
lcd.begin(20,4);
lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
lcd.setBacklight(HIGH);
lcd.home();
lcd.print("Hello, world!");
lcd.setCursor(0,1);
lcd.print("This is a test");
lcd.setCursor(0,2);
lcd.print("Of this PITA");
lcd.setCursor(0,3);
lcd.print("Sainsmarrt LCD");
}
void loop()
{
lcd.setBacklight(HIGH);
delay(4000);
lcd.setBacklight(LOW);
delay(4000) ;
}
I don't get that initialization though, the first line after all the #'s and before the setup function. What's going on there? That looks like a parallel LCD, not serial. Every other I2C LCD example I've seen only put the LCD's address as the argument of that function.