Servo - Slider control

Breadboard for "Servo - Slider control"

docs/breadboard/servo-slider.png

Fritzing diagram: docs/breadboard/servo-slider.fzz

 

Run this example from the command line with:

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

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

  var slider = new five.Sensor("A0");
  var tilt = new five.Servo(9);

  slider.scale([0, 180]).on("slide", function() {

    // The slider's value will be scaled to match the tilt servo range
    tilt.to(this.value);
  });
});

 

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.