Close



Results 1 to 10 of 25

Hybrid View

  1. #1
    Staff Engineer printbus's Avatar
    Join Date
    May 2014
    Location
    Highlands Ranch, Colorado USA
    Posts
    1,437
    Add printbus on Thingiverse
    Looking good. Should someone want to add the display auto-recovery, here's the change. In file ultralcd.cpp, look for...

    Code:
    #ifdef ULTIPANEL
    static void lcd_return_to_status()
    {
          encoderPosition = 0;
          currentMenu = lcd_status_screen;
    }
    and add one line to it...

    Code:
    #ifdef ULTIPANEL
    static void lcd_return_to_status()
    {
          encoderPosition = 0;
          currentMenu = lcd_status_screen;
          lcd_implementation_init();    // added; reinitialize the display module to recover from garbled display mode if happening
    }
    The lcd_implementation_init function already exists. It calls the lcd.begin Arduino LiquidCrystal library function that takes care of initializing the display module. It also sets up a handful of custom character bitmaps like the thermometer symbol, and then it clears the display. I found that just calling lcd.begin would sometimes leave the custom character bitmaps incorrect, so I ended up adding the full init. The only time this additional code is executed is when the LCD display is about to return to the top status screen. The change won't be incorporated unless your configuration.h file invokes the #define for ULTIPANEL.

    FOLLOWUP COMMENT: Looking into the LCD code some more, I see the same lcd_implementation_init is already included as part of software detecting SD card insertion and removal. That code even has a comment with it that talks about how it is an attempt to recover the display from a possible static discharge. So, for a printer standing around doing nothing, just inserting or removing the SD card will also reinitialize the display module, without having to make this change.
    Last edited by printbus; 08-24-2014 at 03:24 AM. Reason: code tags!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •