UNPKG

johnny-five

Version:

The JavaScript Robotics and Hardware Programming Framework. Use with: Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!

26 lines (20 loc) 434 B
var five = require("../lib/johnny-five.js"); 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); });