-
• #2
Please check the nodemcu class to get the correct pin names.
-
• #3
Check the wires and check the id of the i2c device.
-
• #4
Espruino have some function for scan all i2c devices connected?
-
• #5
-
• #6
I tested it, detects two devices in
0x68
(that is MPU) and0x76
(Is the BMP).Here a full log of the error:
Init MPU... Uncaught InternalError: I2CWrite: No ACK 0 at line 1 col 15 a.writeTo(12,c);return a.readFrom(12,d) ^ in function "rmag" called from line 1 col 49 ...ew Uint8Array(this.rmag(3,7))).buffer),b=49120/32760;return{... ^ in function "readMag" called from line 1 col 63 ...eadGyro(),mag:this.readMag(),new:this.dataReady()} ^ in function "read" called from line 3 col 23 data = mpu.read(); ^ in function called from system Uncaught Error: Unhandled promise rejection: InternalError: I2CWrite: No ACK 0
-
• #7
Check the module and try some simple calls.
-
• #8
I'm trying to call
WHO_AM_I
, don't know if this is the correct way to read data, but this is how it works the module, the example in page doesn't explain well, I mean, how to read8 bits
from device0x68
to the address0x75
:I2C1.setup( {scl: NodeMCU.D4, sda: NodeMCU.D5} ); I2C1.writeTo(0x68,0x75); var data = I2C1.readFrom(0x75,8); console.log(data);
But still got the same error:
Uncaught InternalError: I2CRead: No ACK 0 at line 5 col 33 var data = I2C1.readFrom(0x3B,8); ^ in function called from system
Hello,
I'm trying to read a gyroscope (GY-91), that have an MPU-9250 inside with an BMP-280. I'm using this library But I have some problems.
When I'm run the code throw the next error:
I'm trying with a LCD i2c, in case that if is the module that is wrong, but got the same error. Also, doesn't work with
D
pins (D0
,D1
,D2
...) only with numbersAfter change the numbers the LCD works, but the MPU still don't.
Edit: A full log of the error: