void loop(){
mySerial.print("?f"); // clear the LCD
delay(1000);
mySerial.print("?f"); // clear the LCD
delay(100);
delay(3000);mySerial.print("?x00?y0"); // cursor to first character of line 0
mySerial.print("LCD117 serial ?6?7");
mySerial.print("?0?1?2?3?4?5"); // display special charactersdelay(3000);
mySerial.print("?x00?y1"); // move cursor to beginning of line 1
mySerial.print("moderndevice.com"); // crass commercial messagedelay(6000); // pause six secs to admire
mySerial.print("?f"); // clear the LCD
mySerial.print("?x00?y0"); // move cursor to beginning of line 0
mySerial.print(" LCD 117 chip by"); // displys LCD #117 on the screen
mySerial.print("?x00?y1"); // cursor to first character of line 1
mySerial.print(" phanderson.com");delay(3000); // pause three secs to admire
mySerial.print("?f"); // clear the screen
mySerial.print("?x00?y0"); // locate cursor to beginning of line 0
mySerial.print("DEC HEX ASCI"); // print labels
delay(100);
// simple printing demonstation
for (N = 42; N<= 122; N++){ // pick an arbitrary part of ASCII chart - change as you wish
mySerial.print("?x00?y1"); // locate cursor to beginning of line 1mySerial.print(N, DEC); // display N in decimal format
mySerial.print("?t"); // tab inmySerial.print(N, HEX); // display N in hexidecimal format
mySerial.print("?t"); // tab in// glitches on ASCII 63 "?"
if (N=='?'){
mySerial.print("??"); // the "??" displays a single '?' - see Phanderson 117 docs
}
else{
mySerial.print(N, BYTE); // display N as an ASCII character
}mySerial.print(" "); // display 3 spaces (blanks) as ASCII characters
delay(500);
}delay (1000);
mySerial.print("?y0?x00"); // cursor to beginning of line 0
delay(10);
mySerial.print("?l"); // clear line; custom char. 1
delay(10);
mySerial.print(" Bar Graph Demo");
delay(10);
mySerial.print("?n"); // cursor to beginning of line 1 + clear line 1
delay(500);// bar graph demo - increasing bar
for ( N = 0; N <= 80; N++){ // 16 chars * 5 bits each = 80
mySerial.print("?y1?x00"); // cursor to beginning of line 1
delay(10);Num_5 = N / 5; // calculate solid black tiles
for (I = 1; I <= Num_5; I++){
mySerial.print("?5"); // print custom character 5 - solid block tiles
delay(4);
}Remainder = N % 5; // % sign is modulo operator - calculates remainder
// now print the remainder
mySerial.print("?"); // first half of the custom character command; see end note
mySerial.print(Remainder, DEC); // prints the custom character equal to remainder
delay(5);
}delay(50);
for ( N = 80; N >= 0; N--){ // decreasing bar - 16 chars * 5 bits each
mySerial.print("?y1?x00"); // cursor to beginning of line 1
delay(10);Num_5 = N / 5; // calculate solid black tiles
for (I = 1; I <= Num_5; I++){
mySerial.print("?5"); // print custom character 5 - solid block tiles
delay(5);
}Remainder = N % 5; // % 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(5);
}delay(500);
mySerial.print("?f"); // clears screen
delay(50);
mySerial.print(".");
delay(60);
mySerial.print("?y0?x00"); // cursor to beginning of line 0
delay(250);
mySerial.print(" .");
delay(10);mySerial.print("?D0000000000000001F"); // define special characters
delay(300); // delay to allow write to EEPROM
//crashes LCD without delay
mySerial.print("?y0?x00"); // cursor to beginning of line 0
mySerial.print(" ."); // dots for user feedback
delay(10);mySerial.print("?D10000000000001F1F");
delay(300);
mySerial.print("?y0?x00"); // cursor to beginning of line 0
mySerial.print(" . ");
delay(10);mySerial.print("?D200000000001F1F1F");
delay(300);
mySerial.print("?y0?x00"); // cursor to beginning of line 0
mySerial.print(". ");
delay(10);mySerial.print("?D3000000001F1F1F1F");
delay(300);