You are reading a single comment by @veryalien and its replies. Click here to read the full conversation.
  • Wow, nice!

    I've got it going from very faint through to completely black which shows that it's working.

    This sounds like everything's good. I think you want to find the resistor divider setting where 0.5 for contrast is the most readable, and then tweak it more gradually by adjusting the contrast.

    There is a Bias setting as well - you could try manually doing:

        CS.reset();
        spi.write([0xA2], DC);
        CS.set();
    

    And see if that helps - the actual setting I use on Pixl (which uses the same display) are here:
    https://github.com/espruino/Espruino/blo­b/master/libs/pixljs/jswrap_pixljs.c#L50­5

    Whereas the defaults for the ST7565 module are http://www.espruino.com/modules/ST7565.j­s

    LEDs

    Turns out I'm actually using that LED driver on a board I'm doing for someone else. The code isn't public yet so I'll share it here and hopefully you can get some stuff done with it:

      i2c.wl = function(reg,data) { // write to LEDs
       this.writeTo(84,reg,data);
     };
      // SN3218 init
      LED_PWR.set(); // LED on
      i2c.wl(0,1); // no shutdown
      i2c.wl(0x13,[0x3F,0x3F,0x3F]); // led bank 1,2,3
    
      function setLeds(a) { // 18 element array
        if (!a) a = new Uint8Array(18);
        i2c.wl(1,a);i2c.wl(0x16,0x00); 
      }
    
  • Hi Gordon,

    I've got it working... mainly after I realised I needed to connect 5V from the Pico to the GFX HAT to actually get the LEDs to light, doh!

    This line seems to be from your project, it's not needed, I removed it, I'm not sure what it's supposed to do:

    LED_PWR.set(); // LED on

    So now I have the bling-bling RGB backlight on the GFX HAT working with Espruino. 18 LEDs in total, 6 RGB all individually controllable. What a coincidence that Pimoroni used 6 RGB LEDs for the HAT backlight with a SN3218 controller! ;)
    I already knew that Pimoroni connected the RGB LEDs in a strange order, so I'll need some functions before calling setLeds to set the correct colour on the correct LED.

    Now to attack the CAP1166 with Espruino for the touch pads and the white LEDs indicators.

About

Avatar for veryalien @veryalien started