Skip to content

Instantly share code, notes, and snippets.

@ajpiano
Created Aug 19, 2013
Embed
What would you like to do?
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