I have a decimilia with a sparkfun serial LCD plugged into it as a display via hardware serial.
I have had this lcd working properly in the past however recently it has begun exhibiting the following behavior:
- Turn on arduino...splash screen on LCD shows
- LCD shows odd characters (as in, not what I sent it.). It appears as though it is set to the wrong baud rate or something.
but...
- Unplug serial connection to LCD
- Turn on arduino
- LCD shows splash screen then shows a "block" character in the upper left.
- Wait a second or two...
- Plug in serial connection to LCD.
- LCD works as it should
Here is the beginning of my sketch...
void setup(){
pinMode(piezoTriggerPin, OUTPUT);
Serial.begin(9600);
vSerial.begin(9600);
delay(100);
//put wait code to look and see if there is a
//response from the VDIP1. If there isn't try connecting again
vSerial.print("IPA");
vSerial.print(13, BYTE);
Serial.print(0xFE, BYTE);
Serial.print(128, BYTE);
Serial.print("Welcome!"); //change this to the users greeting...also useful as a LCD communication test
Serial.print(0xFE, BYTE);
Serial.print(192, BYTE);
Serial.print(""); //line two of the users splash screen
/*for (int i=0; i<100; i++){
play_piezo();
}*/
delay(6000); //how long to delay on the startup screen.
//Important to delay because we need to wait for the vdip to initialize the usb key
//determine what log file number to begin with
/* vSerial.print("DIR");
vSerial.print(13, BYTE);
delay(1000); //wait a second
//need to add code to check if there is a disk present
//if there isn't then skip the read or it will just hang
while(char i = vSerial.read()){
if (i == '%'){
logfilecount = vSerial.read();
}
}*/
Serial.print(0x7C, BYTE);
Serial.print(157, BYTE); //light level to 157 out of 157
//zero the accelerometer...but only for small tilts
delay(1000);
int tempreading = analogRead(yval);
if ((tempreading < 800) && (tempreading > 200)){
zerogy = tempreading;
}
else {
zerogy = 512;
}
tempreading = analogRead(xval);
if (true) { //((tempreading < 800) && (tempreading > 200)){
zerogx = tempreading;
}
else {
zerogx = 512;
}
//setup the buttons as inputs
pinMode(buttonApin, INPUT);
pinMode(buttonBpin, INPUT);
pinMode(ctsPin, INPUT);
pinMode(rtsPin, OUTPUT);
Serial.print(0xFE, BYTE);
Serial.print(0x01, BYTE); //clear LCD
}