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!
24 lines (18 loc) • 425 B
JavaScript
var five = require("../lib/johnny-five.js");
var board = new five.Board();
board.on("ready", function() {
var motor = new five.Motor({
controller: "EVS_NXT",
pin: "BBM2",
});
board.wait(2000, function() {
console.log("REVERSE");
motor.rev();
// Demonstrate motor stop in 2 seconds
board.wait(2000, function() {
motor.stop();
});
});
console.log("FORWARD");
motor.fwd();
});