Thank you for your quick response, I took a look at the module and it didn't occur to me that the default parameters would be an issue.
I'm still having some issues with this module but I think it is mostly how I'm starting the I2c Communications when Loading this code to RAM.
It sometimes works and starts up right way but a lot of the time it fails to start. I get this:
____ _
| __|___ ___ ___ _ _|_|___ ___
| __|_ -| . | _| | | | | . |
|____|___| _|_| |___|_|_|_|___|
|_| espruino.com
2v25 (c) 2024 G.Williams
>
Uncaught InternalError: Timeout on I2C Write BUSY
at line 1 col 29
this.i2c.writeTo(this.addr,a);return this.i2c.readFrom(this....
^
in function "readBytes" called from line 1 col 25
var g=this.readBytes(a,1)[0],f=(1<<d)-1<<b-d+1;g=g&~f|e<<b-d...
^
in function "writeBits" called from line 1 col 25
this.writeBits(107,2,3,a)
^
in function "setClockSource" called from line 1 col 22
this.setClockSource(1);this.setFullScaleAccelRange(0);this.s...
^
in function "initialize" called from line 1 col 74
...===b?105:b;this.initialize()
^
in function "c" called from line 1 col 10
new c(a,b)
^
in function "connect" called from line 23 col 44
const MPU = require("MPU6050").connect(I2C1);
^
Resetting MPU6050...
Uncaught Error: Can't read property 'reset' of undefined
at line 1 col 45
...tting MPU6050...");this.mpu.reset();setTimeout(k,30,this)
^
in function "initialize" called from line 1 col 44
this.mpu=a;this.fifoRate=b;this.initialize()
^
in function "c" called from line 1 col 10
new c(a,b)
^
in function "create" called from line 25 col 49
const DMP = require("MPU6050_DMP").create(MPU, 1);
I will play with it more to find the source of the issue. I will play with putting the code in flash and setting up the I2c using onInit().
I remember getting I2C devices to initialize is tricky and this may be an issue with how I'm doing things
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.
Thank you for your quick response, I took a look at the module and it didn't occur to me that the default parameters would be an issue.
I'm still having some issues with this module but I think it is mostly how I'm starting the I2c Communications when Loading this code to RAM.
It sometimes works and starts up right way but a lot of the time it fails to start. I get this:
I will play with it more to find the source of the issue. I will play with putting the code in flash and setting up the I2c using onInit().
I remember getting I2C devices to initialize is tricky and this may be an issue with how I'm doing things
Thanks again !