Most recent activity
-
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?
-
Thanks @Gordon that fixed it. It may have also been a loose connection on the mpu... Also thanks @allObjects I see that by loading the modules in onInit(), and other practices, my code is running much more reliably.
-
I'm struggling to get my Puck back to a stable state. If I just send the following:
I2C1.setup({scl:D2, sda:D1, bitrate:100000}); const MPU = require("MPU6050").connect(I2C1);
The ide shows " Prompt not detected - upload failed. Trying to recover..." and then never seems to recover.
I think I need a way to clear out or factory reset the flash memory. I've tried running reset() followed by save(), but that doesn't fix it.
Also the web ide won't connect to my Puck unless I do a hard reset first.
-
Unfortunately, I must have caused a problem with my flash, and I need help returning to a stable state. After a hard 10 second reset, I can connect my puck in the IDE, then with the same connection settings as above, I send the following code to my Puck:
I2C1.setup({scl:D2, sda:D1, bitrate:100000}); const MPU = require("MPU6050").connect(I2C1); var DMP = require("MPU6050_DMP").create(MPU,3); function getData() { var data = DMP.getData(); if(data !== undefined) console.log(data); } setInterval(getData, 1000);
This code worked yesterday, but now I'm seeing an error:
Uncaught InternalError: Timeout on jshFlashWrite
at line 1 col 1078
...*d.z)),roll:Math.a",0,16984);
New interpreter error: FIFO_FULLThen I get a red bar
Prompt not detected - upload failed. Trying to recover...and nothing else.. any advice?
-
Thanks @Gordon, with those settings MPU6050_DMP now works on my Puck
-
I'm able to use the MPU6050 module correctly on my Puck
I2C1.setup({scl:D2, sda:D1, bitrate:100000});
const MPU = require("MPU6050").connect(I2C1);But if I then add the MPU6050_DMP,
var DMP = require("MPU6050_DMP").create(MPU,3);New interpreter error: LOW_MEMORY,MEMORY
Uncaught Error: Function "initialize" not found!
at line 1 col 33
this.mpu=a;this.fifoRate=d;this.initialize()
in function "b" called from line 1 col 10
new b(a,d)
in function "create" called from line 1 col 46
var DMP = require("MPU6050_DMP").create(MPU,3);
Uncaught SyntaxError: Got '?' expected EOF
at line 1 col 1Does anyone know if the MPU6050_DMP works on Puck? Am I just running out of memory? Is there a workaround to get this module loaded onto Puck? Thanks
That change to the code was the answer. The MPU_6050 module is working as local module now, and I can edit it. Thansks @AkosLukacs