I am currently just playing with an LCD and arduino and have used this code (below) to just get some text on the screen but am struggling to get some of the symbols that are shown in the datasheet (http://www.sparkfun.com/datasheets/LCD/GDM1602K-Extended.pdf) Page 9.
My current code is:
void setup()
{
Serial.begin(9600);
backlightOn();
}
void loop()
{
selectLineOne();
delay(100);
Serial.print("hi");
selectLineTwo();
delay(100);
Serial.print("Hi");
delay(100);
}
void selectLineOne(){ //puts the cursor at line 0 char 0.
Serial.print(0xFE, BYTE); //command flag
Serial.print(128, BYTE); //position
}
void selectLineTwo(){ //puts the cursor at line 0 char 0.
Serial.print(0xFE, BYTE); //command flag
Serial.print(192, BYTE); //position
}
void goTo(int position) { //position = line 1: 0-15, line 2: 16-31, 31+ defaults back to 0
if (position<16){
Serial.print(0xFE, BYTE); //command flag
Serial.print((position+128), BYTE); //position
}
else if (position<32){
Serial.print(0xFE, BYTE); //command flag
Serial.print((position+48+128), BYTE); //position
}
else {
goTo(0);
}
}
void clearLCD(){
Serial.print(0xFE, BYTE); //command flag
Serial.print(0x01, BYTE); //clear command.
}
void backlightOn(){ //turns on the backlight
Serial.print(0x7C, BYTE); //command flag for backlight stuff
Serial.print(157, BYTE); //light level.
}
void backlightOff(){ //turns off the backlight
Serial.print(0x7C, BYTE); //command flag for backlight stuff
Serial.print(128, BYTE); //light level for off.
}
void serCommand(){ //a general function to call the command flag for issuing all other commands
Serial.print(0xFE, BYTE);
}
and its displays Hi Hi.
I just want half a row of the square blocks and the 2nd line to also have half a row of square blocks (fully filled in)
These tutorials arent for Serial enabled LCD though is it the same method? really atm i just want to display a set of squares for display purposes... The code i posted above works, is this not the right method to use?