I had one of these laying around so I hooked it up... in case anyone needs it.
// * ------------
// * modified for use with cubloc clcd -> by chris coleman
// * original code -> Copyleft 2006 by djmatic
// * ------------
void setup()
{
beginSerial(115200);
}
void loop()
{
clearLCD();
Serial.print("Hello"); // print text to the current cursor position
Line(3); // start a new line
Serial.print("Arduino");
//cursorSet(1,3);
Serial.print("\t\t\ttest");
delay(5000);
backlightOff();
delay(5000);
backlightOn();
delay(5000);
cursorHome();
delay(5000);
cursorOff();
delay(5000);
}
// LCD FUNCTIONS-- keep the ones you need.
// clear the LCD
void clearLCD(){
Serial.print(27,BYTE);
Serial.print("C");
}
// start a new line
void Line(int line) {
Serial.print(line,BYTE);
}
// move the cursor to the home position
void cursorHome(){
Serial.print(27,BYTE);
Serial.print("H");
}
// DOES NOT WORK CORRECTLY
// e.g.: cursorSet(3,2) sets the cursor to x = 3 and y = 2
void cursorSet(int xpos, int ypos){
Serial.print(27, BYTE);
Serial.print("L");
Serial.print(xpos); //Column position
Serial.print(ypos); //Row position
delay(100);
}
// backspace and erase previous character
void backSpace() {
Serial.print(8, BYTE);
}
// turn cursor On (default)
void cursorOn(){
Serial.print(27, BYTE);
Serial.print("S");
}
// turn cursor Off
void cursorOff(){
Serial.print(27, BYTE);
Serial.print("s");
}
// turn on backlight
void backlightOn(){
Serial.print(27, BYTE);
Serial.print("B");
}
// turn off backlight
void backlightOff(){
Serial.print(27, BYTE);
Serial.print("b");
}