You are reading a single comment by @parasquid and its replies. Click here to read the full conversation.
  • I probably need help in fully converting this into a module.

    Copy pasting into the left hand side as suggested in https://www.espruino.com/Writing+Modules­ works and I'm able to get the sample code working.

    However, doing a

    const ina219 = require("https://raw.githubusercontent.c­om/parasquid/EspruinoDocs/master/devices­/INA219.js").connect(I2C1);
    

    gives some tokenization errors depending on whether or not I have minification turned on.

    Disabling all options for minification now gives me

    Uncaught Error: Function "getBusRaw" not found!
     at line 1 col 25
    const busVoltage = this.getBusRaw();
                            ^
    in function "getBusMilliVolts" called from line 158 col 37
    console.log(ina219.getBusMilliVolts() / 1000 + 'V');
                                        ^
    

    I'm not really sure where I'm tripping up :(

About

Avatar for parasquid @parasquid started