PaulDFoster / pxt-microbit-GY521

A PXT package for the Microbit to drive a MPU-6050 (GY-521)
1 stars 9 forks source link

zeroed outputs from microbit_GY521.getMotion6() #12

Open PaulMuadDib opened 3 years ago

PaulMuadDib commented 3 years ago

Hi there, Trying to use the mpu6050 with the µBit where I downloaded the following basic script:

`let gyrz = 0

let gyry = 0 let gyrx = 0 let accz = 0 let accy = 0 let accx = 0

if (microbit_GY521.testConnection()) { serial.writeLine("GY521 connected") basic.showLeds( . . . . . . . # . . . # # # . . . # . . . . . . . ) } else { serial.writeLine("GY521 not found") basic.showLeds( . . . . . . . . . . . # # # . . . . . . . . . . . ) } basic.forever(function () { microbit_GY521.getMotion6() gyrx = microbit_GY521.readGyroX() serial.writeValue("gyrx", gyrx) gyry = microbit_GY521.readGyroY() serial.writeValue("gyry", gyry) gyrz = microbit_GY521.readGyroZ() serial.writeValue("gyrz", gyrz) accx = microbit_GY521.readAccelX() serial.writeValue("accx", accx) accy = microbit_GY521.readAccelY() serial.writeValue("accy", accy) accz = microbit_GY521.readAccelZ() serial.writeValue("accz", accz) }) ` Although the GY521 is connected, I only get 6-uplets of zeros on the serial: would you have an idea why ? This same sensor is working correctly with an Arduino Yun (with the lib #include "MPU6050_6Axis_MotionApps_V6_12.h"). Best Jean-François