Here are the helper functions (not a library really) that I use with that product:
void displayHome()
{
Serial1.write(254); // move cursor to beginning of first line
Serial1.write(128);
}
void displayMoveTo(int pos)
{
char posChar;
if (pos>=1 && pos<=16) {
posChar = char(128+pos-1);
} else if (pos>=17 && pos<=32) {
posChar = char(192+pos-17);
} else {
posChar = 128; // on error, go home
}
Serial1.write(254);
Serial1.write(posChar);
}
void displayClear()
{
displayHome();
// clear display fast 32 spaces
Serial1.write(" ");
Serial1.write(" ");
displayHome();
}
void displayBacklight(int brightpercent)
{
int mappedBright = map(brightpercent, 0,100,128,157);
// Make sure range is OK
if (mappedBright >= 128 && mappedBright <= 157) {
Serial1.write(124);
Serial1.write(char(mappedBright));
}
}