Hi, everyone!
Working on a project and while it is working, I think I could make it better. I'll put in some fake code to help explain what is happening. Remember, this fake code is only for use as an example. And yes, the syntax is not correct here, being only used as an example. Here goes!
On my 20x4 LCD, I want to print to 0,0 and do so with:
set.cursor (0,0)
lcd.print" Generator is starting"
Now, a minute later, external sensor trips.
And now....
set.cursor (0,0)
lcd.print "over speed."
What happens in the real world is this:
"over speedis starting"
The line is not being cleared of the old text.
My solution has been to do this:
set.cursor(0,0)
lcd.print "overspeed (spaces here) "
and fill the trailing text with spaces. This erases the old text while inserting the new text.
Another issue is, once the generator has started, the text printed to the lcd needs to go.
So, once again I use:
set.cursor(0,0)
lcd.print " 20 spaces "
I print 20 characters of spaces to remove the text from the lcd.
And of course if I print to a different line,:
set.cursor(0,3)
lcd.print "Attention kmart shoppers."
I have to add a line or two to clear the text on the lcd at 0,3 because I want to get rid of that text.
There has to be a better way of doing this! I have used lcd.clear() and while that works, it caused the display to blink/flicker as the code loops through the sketch.
I'm open for comments and ideas, and I'm all ears...
