Avatar for user63099

user63099

Member since Mar 2016 • Last active Oct 2016
  • 0 conversations
  • 5 comments

Most recent activity

  • in Tutorials
    Avatar for user63099

    Thanks for you help @Wilberforce it now works! It worked on direct upload in the beginning, then I figured out the pin setup via dump() and now I got it working with the following code:

    var DISPLAY_CONTRAST = 0.49;
    var LINE_HEIGHT = 6;
    
    digitalWrite(D2, 0);
    digitalWrite(D4, 0);
    digitalWrite(D5, 0);
    pinMode(D0, "input_pullup");
    pinMode(D12, "input_pullup");
    pinMode(D13, "input_pullup");
    pinMode(D14, "input_pullup");
    digitalWrite(D15, 0);
    
    function drawText(oDisplay, aText, iX, iLineHeight) {
      aText.forEach(function (sLine, iIdx) {
        oDisplay.drawString(sLine, iX, iLineHeight * iIdx); 
      });
    }
    
    function begin () {
      SPI1.setup({ sck:D14, mosi:D13 });
      var g = require("PCD8544").connect(SPI1,
        D4 /* RS / DC */,
        D15 /* CS / CE */, 
        D5 /*RST*/, function() {
    
        g.clear();
        g.setContrast(DISPLAY_CONTRAST);
        g.setRotation(2); //Flip display 180
        drawText(g, [
          "Line 1",
          "Line 2",
          "Line 3",
          "Line 4",
          "Line 5",
          "Line 6",
          "Line 7",
          "Line 8"
        ], 0, LINE_HEIGHT);
        g.drawLine(30, 0, 84,48);
        g.drawLine(30, 48, 84, 0);
        g.flip();
    
      });
    }
    
    E.on("init", begin);
    save();
    

    It looks amazing! so thanks again for your help!

  • in Tutorials
    Avatar for user63099

    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...

  • in Tutorials
    Avatar for user63099

    The issue is that I've tried to make the same thing by connecting the ESP8266-12-E to the nokia directly (no NodeMCU board), and I see the Nokia screen blank.

    My setup looks like the one in this picture:

    I think there must be something with the NodeMCU.D* pins mapping... have you tried to use a Nokia 5110 display without the NodeMCU board?

  • in Tutorials
    Avatar for user63099

    Hello - do you have any suggestion about how to do this on a bare ESP8266 12E? Many Thanks

  • in ESP8266
    Avatar for user63099

    Any idea why the ESP8266 12 keeps restarting after flashing when I check via picocom/screen? It keeps showing this over and over:

    ets Jan  8 2013,rst cause:4, boot mode:(3,7)
    
    wdt reset
    load 0x40100000, len 1396, room 16 
    tail 4
    chksum 0x89
    load 0x3ffe8000, len 776, room 4 
    tail 4
    chksum 0xe8
    load 0x3ffe8308, len 540, room 4 
    tail 8
    chksum 0xc0
    csum 0xc0
    
    2nd boot version : 1.4(b1)
      SPI Speed      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 32Mbit(512KB+512KB)
    jump to run user1 @ 1000
    
    rS
     _____                 _ 
    |   __|___ ___ ___ _ _|_|___ ___ 
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v84.tve_master_588d193 Copyright 2015 G.Williams
    WARNING: the esp8266 port is in beta!
    Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
    

    Could that be the power supply?

Actions