Permalink
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (36 sloc) 1.01 KB

Expander - LIS3DH

Using an LIS3DH Expander as a Virtual Board (3 Pin Analog Input: 0.9V-1.8V)

Breadboard for "Expander - LIS3DH"

docs/breadboard/expander-LIS3DH.png

Fritzing diagram: docs/breadboard/expander-LIS3DH.fzz

 

Run this example from the command line with:

node eg/expander-LIS3DH.js
var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
  var virtual = new five.Board.Virtual(
    new five.Expander("LIS3DH")
  );

  var sensor = new five.Sensor({
    pin: "A2",
    board: virtual
  });

  sensor.on("data", function() {
    console.log(sensor.value);
  });
});

 

License

Copyright (c) 2012-2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2015-2018 The Johnny-Five Contributors Licensed under the MIT license.