Permalink
017e5f1 Jun 8, 2018
4 contributors

Users who have contributed to this file

@rwaldron @Resseguie @dtex @BrianGenisio
78 lines (41 sloc) 1.02 KB

Servo - PCA9685

Breadboard for "Servo - PCA9685"

docs/breadboard/servo-PCA9685.png

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

 

Run this example from the command line with:

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

board.on("ready", function() {
  console.log("Connected");

  // Initialize the servo instance
  var a = new five.Servo({
    address: 0x40,
    controller: "PCA9685",
    pin: 0,
  });

  var b = new five.Servo({
    address: 0x40,
    controller: "PCA9685",
    range: [0, 180],
    pin: 1,
  });

  var degrees = 0;

  a.to(degrees);
  b.to(degrees);
});

 

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.