You are reading a single comment by @Owen and its replies. Click here to read the full conversation.
  • Hi guys,
    I've got a HD44780 LCD character Display Module and I'm trying to get it working with Espruino. I've followed the guide here http://www.espruino.com/HD44780 and installed the HD33780 module, but whenever I run the code I get the following error:

    // My code
    var lcd = require("HD44780").connect(A4,A5,A0,A7,A2,A3);
    lcd.print("Hello World!");
    
    // Error returned
    >echo(0);
    ERROR: Got ':' expected '(' at line 1 col 94
    {a(51,1);a(50,1);a(40,1);a(12,1);a(6,1);a(1,1);return{write:a,clear:function(){a(1,1)},print:function(b){for(var c=0;c<b.length;c++)a(Integer.valueOf(b.charAt(c)))},cursor:function(b){a(b?15:14,1)},setCursor:function(b,c){a(128|[0,64,20,84][c]+b,1)},createChar:function(b,c){a(64|(b&7)<<3,1);for(var d=0;8>d;d++)a(c[d]);a(128,1)}}}
                                                                                                  ^
    ERROR: Got function expected ':' at line 1 col 95
    {a(51,1);a(50,1);a(40,1);a(12,1);a(6,1);a(1,1);return{write:a,clear:function(){a(1,1)},print:function(b){for(var c=0;c<b.length;c++)a(Integer.valueOf(b.charAt(c)))},cursor:function(b){a(b?15:14,1)},setCursor:function(b,c){a(128|[0,64,20,84][c]+b,1)},createChar:function(b,c){a(64|(b&7)<<3,1);for(var d=0;8>d;d++)a(c[d]);a(128,1)}}}
                                                                                                   ^
    at line 1 col 102
    {a(51,1);a(50,1);a(40,1);a(12,1);a(6,1);a(1,1);return{write:a,clear:function(){a(1,1)},print:function(b){for(var c=0;c<b.length;c++)a(Integer.valueOf(b.charAt(c)))},cursor:function(b){a(b?15:14,1)},setCursor:function(b,c){a(128|[0,64,20,84][c]+b,1)},createChar:function(b,c){a(64|(b&7)<<3,1);for(var d=0;8>d;d++)a(c[d]);a(128,1)}}}
                                                                                                          ^
    in function "HD44780" called from line 1 col 185
    in function "connect" called from line 1 col 55
    ERROR: Using '.' operator on non-object at line 1 col 4
    lcd.print("Hello World!");
        ^
    =undefined
    > 
    

    Do you have any idea what's going wrong here? I've tried writing the module code directly but I get much the same results. What should I try next to fix this?
    Thanks

About

Avatar for Owen @Owen started