Using an PCF8591 Expander as a Virtual Board (4 Pin Analog Input)
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);
});
});
Copyright (c) 2012, 2013, 2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2016 The Johnny-Five Contributors Licensed under the MIT license.