I searched the internet and the Particle forum for information on how to set up a 20x4 serial LCD screen and could not find a direct answer. I have a simple sketch that loops to display characters on all 4 lines. Purchase and connection information is in the comments for anyone desiring to get one going. A copy of the code follows:
// test_loop_4x20_lcd
#include "LiquidCrystal_I2C_Spark/LiquidCrystal_I2C_Spark.h"
/*
Connect the LCD screen to 5v. 3v3 is not sufficient to power the unit
Use 4.7K pull up resistors to 5v on SDA (D0), SCL (D1) lines
I2C Address is: 0x3F
LCD is a Blue Serial 2004 20x4 Character IIC I2C TWI 5v LCD Module Display Screen for Arduino,
available from Ebay for $5.42
*/
#include "application.h"
char Photon_Msg[] = "---- My Photon ----";
char Charac_Msg[] = "ABCDEFGHIJKLMNOPQRST";
char Numeri_Msg[] = "01234567890987654321";
char Mixtur_Msg[] = "This is a nice print";
LiquidCrystal_I2C *lcd;
void setup()
{
lcd = new LiquidCrystal_I2C(0x3F, 20, 4);
lcd->init();
lcd->backlight();
lcd->clear();
}
void loop()
{
lcd->setCursor(0,0);
for(int i=0; i<20; i++)
{
lcd->setCursor(i,0);
lcd->print(Photon_Msg[i]);
delay(100);
}
for(int i=0; i<20; i++)
{
lcd->setCursor(i,1);
lcd->print(Charac_Msg[i]);
delay(100);
}
for(int i=0; i<20; i++)
{
lcd->setCursor(i,2);
lcd->print(Numeri_Msg[i]);
delay(100);
}
for(int i=0; i<20; i++)
{
lcd->setCursor(i,3);
lcd->print(Mixtur_Msg[i]);
delay(100);
}
delay(1000);
lcd->clear();
}