This should be it...
delay(50);
for ( N = 0; N <= 15; N++){
mySerial.print("?y1?x00"); // cursor to beginning of line 1
delay(10);
if (N < 8){
mySerial.print("?y0?x00 "); // cursor to beginning of line 1 and writes blank space
mySerial.print("?y1?x00");
Remainder = (N % 8); // % sign is modulo operator - calculates remainder
// now print the remainder
mySerial.print("?"); // first half of the custom character command
mySerial.print(Remainder, DEC); // prints the custom character equal to remainder
delay(10);
}
else{
mySerial.print("?y1?x00?7"); // cursor to beginning of line 1 and writes black character
mySerial.print("?y0?x00");
Remainder = (N % 8); // % sign is modulo operator - calculates remainder
// now print the remainder
mySerial.print("?"); // first half of the custom character command
mySerial.print(Remainder, DEC); // prints the custom character equal to remainder
delay(10);
}
}
delay(100);
for ( N = 15; N >= 0; N--){ // 16 chars * 8 bits each = 80
mySerial.print("?y1?x00"); // cursor to beginning of line 1
delay(10);
if (N < 8){
mySerial.print("?y0?x00 "); // cursor to beginning of line 1 and writes blank space
mySerial.print("?y1?x00");
Remainder = (N % 8); // % sign is modulo operator - calculates remainder
// now print the remainder
mySerial.print("?"); // first half of the custom character command
mySerial.print(Remainder, DEC); // prints the custom character equal to remainder
delay(10);
}
else{
mySerial.print("?y1?x00?7"); // cursor to beginning of line 1 and writes black character
mySerial.print("?y0?x00");
Remainder = (N % 8); // % sign is modulo operator - calculates remainder
// now print the remainder
mySerial.print("?"); // first half of the custom character command
mySerial.print(Remainder, DEC); // prints the custom character equal to remainder
delay(10);
}
}
delay(1000);
mySerial.print("?f"); // clear the LCD
/* experimental backlight control
mySerial.print(" Backlight ");
mySerial.print("?x00?y1"); // move cursor to beginning of line 1
mySerial.print(" Adjustment ");
delay(1000);
mySerial.print("?B10"); // set backlight to ...
delay(1000); // pause to allow LCD EEPROM to program
mySerial.print("?B30"); // set backlight to ...
delay(1000); // pause to allow LCD EEPROM to program
mySerial.print("?B60"); // set backlight to 40 hex
delay(1000); // pause to allow LCD EEPROM to program
mySerial.print("?B90"); // set backlight to ...
delay(1000); // pause to allow LCD EEPROM to program
mySerial.print("?Bbf"); // set backlight to 40 hex
delay(1000);
*/
}