Skip to content

Latest commit

 

History

History
75 lines (39 loc) · 986 Bytes

servo-PCA9685.md

File metadata and controls

75 lines (39 loc) · 986 Bytes

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
const {Board, Servo} = require("johnny-five");
const board = new Board();
const controller = "PCA9685";

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

  // Initialize the servo instance
  const a = new Servo({
    controller,
    pin: 0,
  });

  const b = new Servo({
    controller,
    range: [0, 180],
    pin: 1,
  });

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

 

License

Copyright (c) 2012-2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2015-2023 The Johnny-Five Contributors Licensed under the MIT license.