Permalink
017e5f1 Jun 8, 2018
3 contributors

Users who have contributed to this file

@rwaldron @dtex @BrianGenisio
70 lines (34 sloc) 1.12 KB

Board - Specify Sampling Interval

Use the board's samplingInterval(ms) to control the actual MCU sampling rate.

Breadboard for "Board - Specify Sampling Interval"

docs/breadboard/board-sampling-interval.png

 

Run this example from the command line with:

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

board.on("ready", function() {

  // Use the board's `samplingInterval(ms)` to
  // control the actual MCU sampling rate.
  //
  // This will limit sampling of all Analog Input
  // and I2C sensors to once per second (1000 milliseconds)
  this.samplingInterval(1000);


  // Keep in mind that calling this method
  // will ALWAYS OVERRIDE any per-sensor
  // interval/rate/frequency settings.
});

 

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.