Hello everyone, I'm trying to work with the accelerometer/gyroscope in the puck.js v2.
I wrote a small script to transmitt accelerometer data over bluetooth as follows:
var running = false; function accelHandlerTrigger(data) { console.log(data); var d = [ "A", Math.round(data.acc.x), Math.round(data.acc.y), Math.round(data.acc.z) ]; Bluetooth.println(d.join(",")); } setWatch(function() { if (running) { Puck.accelOff(); Puck.removeListener('accel', accelHandlerTrigger); running = false; } else { running = true; Puck.accelOn(52); Puck.on('accel', accelHandlerTrigger); } }, BTN, {repeat:true});
However, the sensor measurements that I get seems to be too high. For example:
"acc": { "x": -342, "y": 398, "z": 8270 }, "gyro": { "x": 313, "y": -299, "z": -92 } "acc": { "x": -319, "y": 371, "z": 8098 }, "gyro": { "x": 167, "y": -290, "z": -69 }
From my understanding, the accelerometer default is ±2g and the gyroscope default is ±125 dps.
Is this correct? or why are the values too high?
@user116256 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.
Hello everyone,
I'm trying to work with the accelerometer/gyroscope in the puck.js v2.
I wrote a small script to transmitt accelerometer data over bluetooth as follows:
However, the sensor measurements that I get seems to be too high. For example:
From my understanding, the accelerometer default is ±2g and the gyroscope default is ±125 dps.
Is this correct? or why are the values too high?