You are reading a single comment by @user63099 and its replies. Click here to read the full conversation.
  • Hi - yes, same code.

    Had already wired to GPIO4, GPIO5, and GPIO13, GPIO14, GPIO15 before but I gave multiple careful checks. Note the GPIO15 is also already pulled down with a 1Kohm resistor, it should be wired like this if I want the ESP to boot I think - I connected it to CE on the display anyways.

    I tried to switch this to various pins (GPIO 2, GPIO0, GPIO12) but nothing is shown on the display. I have tested the display with an arduino so that shouldn't be the problem.

    Also I've tried with the following code as well:

    var g;
    var contrast = 0;
    function begin () {
      console.log("begin");
      SPI1.setup({ sck:NodeMCU.D5, mosi:NodeMCU.D7 });
      g = require("PCD8544").connect(SPI1,
        NodeMCU.D2 /* RS / DC */,
        NodeMCU.D8 /* CS / CE */, 
        NodeMCU.D1 /*RST*/, function() {
        
        console.log("executing with contrast " + contrast);
    
        g.clear();
        g.setContrast(contrast);
        g.setRotation(2); //Flip display 180
        g.drawString("Hi Esp8266",0,0);
        g.drawString("Hi Esp8266",0,10);
        g.drawString("Hi Esp8266",0,20);
        g.drawString("Hi Esp8266",0,30);
        g.drawString("Hi Esp8266",0,40);
        g.drawLine(0,0,84,48);
        g.flip();
        
        setTimeout(function () {
          contrast += 0.1;
          if (contrast > 1) { contrast = 0; }
          begin();
          
        }, 800);
        
        console.log("Executed");
      });
    }
    E.on("init", begin);
    save();
    

    And I see an output like the following on the console:

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v85.tve_master_66fde09 Copyright 2016 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
    >echo(0);
    =undefined
    Erasing Flash.....
    Writing......
    Compressed 25600 bytes to 3437
    Checking...
    begin
    executing with contrast 0
    Executed
    begin
    executing with contrast 0.1
    Executed
    begin
    executing with contrast 0.2
    Executed
    begin
    executing with contrast 0.3
    Executed
    begin
    executing with contrast 0.4
    Executed
    begin
    executing with contrast 0.5
    Executed
    begin
    executing with contrast 0.6
    Executed
    begin
    executing with contrast 0.7
    Executed
    begin
    executing with contrast 0.8
    Executed
    begin
    executing with contrast 0.9
    Executed
    begin
    executing with contrast 1
    

    But nothing to do...

About

Avatar for user63099 @user63099 started