Permalink
017e5f1 Jun 8, 2018
3 contributors

Users who have contributed to this file

@rwaldron @dtex @BrianGenisio
59 lines (32 sloc) 763 Bytes

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-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.