I was able to use the online MPU_6050 module in my project, and now I want to use it as a local module, so I can edit it. I set up my sandbox, and followed the process here: http://forum.espruino.com/conversations/286424/
I copied MPU_6050.js to my sandbox\modules folder and names it "MPU_b.js". Then I tried the following project code:
I2C1.setup({scl:D2, sda:D1, bitrate:100000});
var mpu, mpuM = require("MPU_b")
function onInit() {
mpu = mpuM.connect(I2C1);
}
but I'm getting an error:
Uncaught SyntaxError: Got '=' expected ','
at line 263 col 65
...ction(bank, prefetchEnabled=false, userBank=false) {
Is the online MPU_6050.js not formatted correctly to be used as a local module? Do I need to modify it, or change settings so I can load it in my project?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I was able to use the online MPU_6050 module in my project, and now I want to use it as a local module, so I can edit it. I set up my sandbox, and followed the process here: http://forum.espruino.com/conversations/286424/
I copied MPU_6050.js to my sandbox\modules folder and names it "MPU_b.js". Then I tried the following project code:
but I'm getting an error:
Is the online MPU_6050.js not formatted correctly to be used as a local module? Do I need to modify it, or change settings so I can load it in my project?