PCD8544 issue

Posted on
  • Trying to run the example code for the PCD8544 and get the following error. Looks like it is a problem in the module. How can I fix this?

    SPI1.setup({ baud: 2000000, sck:A5, mosi:A7, order:'msb' });
    
    var g;
    
    function onInit() {
      g = require("PCD8544").connect(SPI1,A6,C1,C3­);}
                                     
    function lcd() {
        g.clear();
        g.drawString("Hello",0,0);
        g.drawLine(0,10,84,10);
        g.flip();
      }
    
    >onInit()
    ERROR: Using '.' operator on non-object at line 1 col 16
    {var a=Graphics.createArrayBuffer(84,48,1,{ve­rtical_byte:!0});setTimeout(function(){d­igitalWrite(c,0);digitalPulse(f,0,10);se­tTimeout(function(){b.send([33,191,20,6,­32,12],d);void 0!==e&&e()},100)},100);a.flip=function()­{digitalWrite(c,0);b.send([64,128],d);di­gitalWrite(c,1);b.send(this.buffer,d)};a­.setContrast=function(a){digitalWrite(c,­0);b.send([33,128|Math.clip(127*a,0,127)­,32,12],d)};return a}
                    ^
    at line 1 col 34
    {var a=Graphics.createArrayBuffer(84,48,1,{ve­rtical_byte:!0});setTimeout(function(){d­igitalWrite(c,0);digitalPulse(f,0,10);se­tTimeout(function(){b.send([33,191,20,6,­32,12],d);void 0!==e&&e()},100)},100);a.flip=function()­{digitalWrite(c,0);b.send([64,128],d);di­gitalWrite(c,1);b.send(this.buffer,d)};a­.setContrast=function(a){digitalWrite(c,­0);b.send([33,128|Math.clip(127*a,0,127)­,32,12],d)};return a}
                                      ^
    in function "connect" called from line 2 col 47
    in function "onInit" called from line 1 col 8
    
  • What board are you using? That error looks like it's coming from the first time it tries to use the Graphics library. The Graphics library is not available on boards with very low flash, like the Olimexino.

  • DrAzzy is spot on by the look of it... But also, are you using the latest firmware? It looks from the format of the error like it is at least a month or two old.

  • I was using a STMf3 discovery board. Since then I have received a Espruino board and now it seems to work. I have another question on the LCD but will post in a new thread.

  • Thanks for letting us know - I just checked and it looks like Graphics support wasn't included in the F3 build for some reason. I've just changed that so it should be in 1v65.

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

PCD8544 issue

Posted by Avatar for user7143 @user7143

Actions