Thanks for your post, I got my LCD displaying text.
However, I was wondering if anyone could shed some light on a weird issue I've seen.
I found that if I instantiate my DfRobotLcdShield class with the class type (instead of var), I just get garbage on the display.
For example, this works fine...
var lcdshield = new DfRobotLcdShield();
This does not (produces garbage output on the screen)...
DfRobotLcdShield lcdshield = new DfRobotLcdShield();
I'm not opposed to using var, but two things...
- Just plain curiass as to why this is.
- I would like to make a global field for the LCD but from my understanding, var can not be used as a global field.
Replacing it with "var" should not make a difference. But I've noticed many times that simply resetting it at the wrong time does not "flush" the buffer. Try pressing the reset switch when you see garbage on the screen, or remove power and plug it back in again. This clears up the screen 100% of the time (for me). Try putting a delay of about 20ms before writing anything to the display. It takes a short time to initialize before it's ready to listen.