Two modules working at the same time.

Posted on
  • Hi, Gordon!
    If I use

    var lcd = require("HD44780").connect(A1,A2,A3,A4,A­5,A6);
    

    It works well on My vldiscovery board, I can give out text and variables to LCD.
    If use also

    var sensor = require("DS18B20").connect(B1);
    

    it gives me a lot of errors like

    ERROR: Function not found! Skipping. at line 1 col 30
    var lcd = require("HD44780").connect(A1,A2,A3,A4,A­5,A6);
                                 ^
    =undefined
    ERROR: Using '.' operator on non-object at line 1 col 8
        lcd.clear();
           ^
    =undefined
    ERROR: Using '.' operator on non-object at line 1 col 8
        lcd.setCursor(0,0);
           ^
    =undefined
    ERROR: Using '.' operator on non-object at line 1 col 8
        lcd.print("Current data:");
           ^
    =undefined
    ERROR: Using '.' operator on non-object at line 1 col 8
        lcd.setCursor(4,1);
           ^
    =undefined
    ERROR: Using '.' operator on non-object at line 1 col 8
        lcd.print("B1 = ");
    

    Is It the restriction of non-multitask, or someth. else? Thanks.

  • Hi Andrey,

    It shouldn't be a restriction... Can you try typing just require("HD44780") on the left and see what is reported back? Maybe also memory().

    I've just tried the code here and it seems to work fine... However I haven't tried it on the VL board, and looking at the memory usage it seems like you're going to be really close to (if not overflowing) the available memory - which could be the problem.

    Sorry about that - but the VL board really doesn't have that much memory for Espruino and extra modules. All the other boards have at least 2.5x more RAM!

    It could be made to work better on the VL board, but right now nobody seems willing to put in the effort, and I don't have time :( I just added a bug to help describe the problem though: https://github.com/espruino/Espruino/iss­ues/145

    If you really wanted the LCD and the temp sensor, you could take the LCD module (http://www.espruino.com/modules/HD44780.­js), copy it into your code manually, and remove all the functionality that you don't need.

  • Ok, thank you for the explanations, I keep doing my exercises :-). And also, It's really amazing project! Thanks for your job!

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

Two modules working at the same time.

Posted by Avatar for Andrey @Andrey

Actions