Sainsmart 1602 LCD shield causes sketch to run incorrectly

The code is certainly a lot easier to read now. Thanks for fixing that.

This is not the code that you're having trouble with, though, is it? I read your original post as saying that this code works as a stand-alone program but when you integrate the LCD code with it, you have problems. I'm not making any rash promises about providing help but without the troublesome code, I'm pretty sure I'll be useless. Even with the code............well, we'll see.