If you're talking about the mpu6050, that function returns an array with three members.
(this code isn't tested, ofc - I don't have that part)
var mpu=require("MPU6050").connect();
var t = mpu.getDegreesPerSecond();
if (t[1] > some_number ) { //t[1] is the second member of the array, hence Y axis
console.log("Wheee! y rotation rate is "+t[1].toString());
} else {
console.log("Booo! y rotation rate is only "+t[1].toString());
}
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.
Uh?
If you're talking about the mpu6050, that function returns an array with three members.
(this code isn't tested, ofc - I don't have that part)