Here's the code I'm using btw (the same as in the docs, just the I2C options and trigger changed)
I2C1.setup({scl:A5, sda:A4}); const MPU = require("MPU6050").connect(I2C1); // 2nd parameter is the fifoRate. The DMP output frequency = 200Hz / (1 + fifoRate) const DMP = require("https://raw.githubusercontent.com/espruino/EspruinoDocs/master/devices/MPU6050_DMP.js").create(MPU, 3); function pidLoop(args) { var data = DMP.getData(); if(data !== undefined) console.log(DMP.getYawPitchRoll(data)); } setWatch(pidLoop, D13, { repeat:true, edge:'rising' });
@parasquid started
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.
Here's the code I'm using btw (the same as in the docs, just the I2C options and trigger changed)