Custom Data Properties

Run this example from the command line with:

node eg/custom-properties.js
var five = require("../");
var board = new five.Board();

board.on("ready", function() {
  // The "custom" property is available
  // to all component class constructors
  var sensor = new five.Sensor({
    pin: "A0",
    custom: {
      a: 1,
      b: 2,
    }
  });

  console.log(sensor.custom.a);
  console.log(sensor.custom.b);
});

 

License

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.