Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ajpiano
Created August 19, 2013 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajpiano/6273096 to your computer and use it in GitHub Desktop.
Save ajpiano/6273096 to your computer and use it in GitHub Desktop.
basic lynxmotion al5d init
var five = require("johnny-five"),
temporal = require("temporal"),
board = new five.Board(),
servos = {},
inits = [
{
id: "rotator",
opts: {
pin: 3,
startAt: 90
}
},
{
id: "shoulder",
opts: {
pin: 5,
startAt: 90
}
},
{
id: "elbow",
opts: {
pin: 6,
startAt: 90
}
},
{
id: "wrist",
opts: {
pin: 9
}
},
{
id: "gripper",
opts: {
pin: 10
}
}
];
board.on("ready", function() {
inits.forEach(function(init) {
servos[ init.id ] = new five.Servo( init.opts );
});
board.repl.inject(servos);
/*
temporal.queue([
{
delay: 2000,
task: function() {
servos.elbow.to(0);
servos.shoulder.to(45);
}
}
]);
*/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment