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

Expander - PCF8591

Using an PCF8591 Expander as a Virtual Board (4 Pin Analog Input)

Breadboard for "Expander - PCF8591"

docs/breadboard/expander-PCF8591.png

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

 

Run this example from the command line with:

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

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

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

  a.on("change", function() {
    console.log(this.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.