Author Topic: No text displayed on the LCD  (Read 9088 times)

Niclas

  • NewMember
  • *
  • Posts: 3
No text displayed on the LCD
« on: January 05, 2018, 08:47:12 PM »
I'm using the standard sketch for the MightyHat.
I have the R3 version (just got it two weeks ago).
I have not commented out the line with ENABLE_LCD
I have no nodes attached to the system yet.
During startup I see the Logo for 2 secs and then nothing.

Added a few lines of code in the Button 1 - backlight part.
I print the battery voltage to the debug port and it show up fine on my PC.
At the same time the backlignt increases for every press as it should.
This code below should print text on the LCD but nothing shows:

    LCD_BACKLIGHT(backlightLevel);
    sprintf(lcdbuff, "LCDlight:%d/100", 100*backlightLevel/BACKLIGHTLEVELS);
    refreshLCD();

Any ideas anyone?

syrinxtech

  • Sr. Member
  • ****
  • Posts: 347
  • Country: us
    • Syrinx Technologies
Re: No text displayed on the LCD
« Reply #1 on: January 07, 2018, 01:13:25 PM »
Niclas,

I think you left out a lcd.print().

Your code sets the backlight level, and then uses sprintf to assign text to the lcdbuff variable, but you never print it.

Try adding:

Code: [Select]
lcd.print(lcdbuff);

before the refreshLCD(); line.



Niclas

  • NewMember
  • *
  • Posts: 3
Re: No text displayed on the LCD
« Reply #2 on: January 07, 2018, 05:53:39 PM »
I just referred to the code written by Felix, the function refreshLcd has a lot of calls to lcd.print.
I have not changed a single line of code yet.

The MightyHat-code uses u8glib to talk to the Nokia LCD.
Perhaps I should rewrite the code and use the lib LCD5110_Graph instead?
I used that one when doing a 18650 battery cell charger/capacity tester with a Arduino Nano.

It also dos stuff with the PIN_LCD_CS (CS for Chip Select?).
It is beeing set HIGH on two places but never LOW, I reccon it should always be HIGH then.

If anyone out there has it working on the R3 version of the PCB let me know.
I saw the logo during startup once or twice but not anymore.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: No text displayed on the LCD
« Reply #3 on: January 08, 2018, 11:01:46 AM »
The sketch and u8glib works as is.
Sometimes the Nokia LCDs have a poor contact with the PCB and the frame needs to be tightened a little. Try that first and see if it works better.

Neko

  • NewMember
  • *
  • Posts: 37
  • Country: us
Re: No text displayed on the LCD
« Reply #4 on: December 19, 2018, 10:57:02 PM »
I am having the same problem. The 4 lights on the LCD light, but no text. The frame seems tight to the board.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: No text displayed on the LCD
« Reply #5 on: December 20, 2018, 01:41:41 PM »
I would press it with your finger and wait until the LCD updates, to see if that produces better image. If so, it means the little rubber thing between the LCD glass and the PCB is not making great contact. The Nokia 5110s are pretty notorious on this issue. Maybe MHat R4 will use the other OLED which I personally like a lot better (its just not as low power as 5110, not that it really matters in most projects).

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: No text displayed on the LCD
« Reply #6 on: December 20, 2018, 10:36:26 PM »
Would it be easy to retro fit a R3 MHat to an Oled display? I'd probably program the the display to turn off in power loss event to allow the battery to last a bit longer.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: No text displayed on the LCD
« Reply #7 on: December 21, 2018, 10:23:14 AM »
Hey,
Thanks to a tip from another user I found these TFT displays which are the same pinout as the Nokia 5110, and are much higher resolution, full color.
I havent tried this specific one yet but they are the same generic ST7735S controller which works wonderfully with the excellent u8g2 display library.
If you have an equivalent TFT already, but different pinout, and can route the wiring to your existing MightyHat, that will work as well.
Anyway these might be a very good candidate for replacing the Nokia 5110 in a future revision. I would not expect any such contact/image issues with these.

Here's a chinese source:
https://www.ebay.com/itm/401010353521

And a US seller, you may find them in EU or other regional e-shops:
https://www.ebay.com/itm/202435207493

And a tutorial:
[/youtube]