obniz Parts Library

Grove_3AxisAccelerometer

GitHub
Grove_3AxisAccelerometer
Usable Devices :
obniz_board
m5stickc
Found at :
www.seeedstudio.com

Grove_3AxisAccelerometer

Library for Grove 3-axis accelerometer moduleGrove - 3 Axis Digital Accelerometer(±16g)

wired(scl, sda {, vcc, gnd, grove})

Connect pins to an obniz Board.

grove cable obniz
scl - scl
sda - sda
vcc - vcc
gnd - gnd
// Javascript Example
var accelMeter = obniz.wired("Grove_3AxisAccelerometer", { scl:0, sda:1, vcc:2, gnd:3 });

If the device has a grove interface, it can be connected with just the parameter {grove: obniz.grove0}.

// Javascript Example
var accelMeter = obniz.wired("Grove_3AxisAccelerometer", {grove: obniz.grove0});

[await] getWait()

Get values from sensor.
It return values in array which has three elements.
Values are unit of gravity, "g".

// Javascript Example
var accelMeter = obniz.wired("Grove_3AxisAccelerometer", { scl:0, sda:1, vcc:2, gnd:3 });
var val = await accelMeter.getWait(); // [x,y,z]
console.log(val);

Supported from: obniz.js 3.5.0