body, html {font-family: 'Open Sans', sans-serif;} #nav a, #nav span.in{font-family: 'Open Sans', sans-serif;} #title #tagline {font-family: 'Open Sans', sans-serif;} #main .gridItem h3 {font-family: 'Open Sans', sans-serif;}

My LCD routines modified

When watching the video of Tim about his „Travel West Virginia“ cache, I discovered that the last 3 digits of the cache name weren’t displayed on the LCD screen. When I’ve pointed to that, he said „Doesn’t matter, the cacher will know…“ For me, as the programming part of our „joint venture" this answer isn’t satisfying…

Now it’s the first time, my programming in different tabs („modules“) will offer real benefit. All code to deal with the LCD is inside the module „Z_LCD.ino“. In the past this module offered:

  • displaySplashScreen() to show the first welcome screen with the geocaching logo at the top left.
  • LCDWrite() to write text to the LCD with a maximum length as defined by the LCD
  • LCDCenter() to automatically center the text of beach line. It worked like a pre-part to LCDWrite. By the lenght of each line was decided, how many spaces are needed in front of the line, to show it centered.
  • LCDScroll() was to scroll text from the right to the lines. But the maximum length was still the maximum columns of the display. And in addition this funktion was never running well and so more or less never used.

What I have changed?

  • LCDScroll() now disappeared.
  • LCDScroll() added, but this will nver be called by a main program. It will only called by LCDWrite() or displaySplashScreen.
  • LCDWrite() will now check the length of the text to be shown. If it’s longer than the LCD is able to show, LCDSroll() is called and this line will scroll from right to left. Important is that’s there’s no limit for the length of the text (not really true). The text will appear on the right, moving to the left and disappearing there.
  • displaySplashScreen() like the the new LCDWrite(). But here another option of the new LCDScroll() is used. I have integrated an offset from left. For displaySplashScreen() this offset is set to 4 for the first two lines. So the geocaching logo will stay in the first 4 digits of the first two lines.

What’s more? You can use this new version of Z_LCD.ino with all my previous sketches without any change. If you have used the old LCDScrol()l, just change this function call to LCDWrite(), because LCDWrite() will now scroll, if needed.

There’s a varialbe Del_Scroll used which is defining the speed of the scrolling. I think, 350 ms are quite fine. If you’re using my Z_LCD.ino with a new program, you shouldn’t declare this variable here but in your main program (and comment it out here).

Here’s a short video about…


For all who want to test this litte module, just download all common subs here...












©  Olaf Goette 2008 - 2018