Bangle.js screen contrast

Posted on
  • Hi! I've noticed that (I think) the Bangle Beta devices must have a slightly different LCD than my development device, and the Gamma/contrast is way off.

    Try:

    for (var i=0;i<240;i+=2) {
      var c = i/240;
      g.setColor(c,c,c);
      g.fillRect(i,0,i+1,239);
    }
    

    You'd hope it was a smooth gradient, but it's probably not. I did some hacking around and got:

    function setGamma(gamma) {
      Bangle.lcdWr(0xe0,gamma); // PVGAMCTRL
      Bangle.lcdWr(0xe1,gamma); // NVGAMCTRL
    }
    
    Bangle.setLCDPower(1);
    Bangle.setLCDTimeout(0);
    
    // index 1 onwards changes the lighter end of gamma
    // last array elements change the darker end of gamma
    setGamma([0x70,0x1f,0x20,0x15,0x10,0x09,0x48,0x33,0x53,0x0B,0x19,0x15,0x2a,0x2f]);
    

    But if anyone feels like poking around and trying to get it better, feel free!

    Issue here: https://github.com/espruino/Espruino/issues/1758

    Screen datasheet here: https://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7789V.pdf

    It's the PVGAMCTRL register than needs tweaking, but there's very little info on what the values mean!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle.js screen contrast

Posted by Avatar for Gordon @Gordon

Actions