Skip to content

Instantly share code, notes, and snippets.

@Resseguie
Created June 6, 2014 03:00
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 Resseguie/4d4e867c54ae7bb452e0 to your computer and use it in GitHub Desktop.
Save Resseguie/4d4e867c54ae7bb452e0 to your computer and use it in GitHub Desktop.
demonstrate servo on Spark A0
var five = require("johnny-five"),
Spark = require("../lib/spark"),
board;
// Create Johnny-Five board connected via Spark
board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID
})
});
board.on("ready", function() {
console.log("I'm Alive and loading thru node!");
servo = new five.Servo({
pin: 'A0',
type:"continuous"
});
board.repl.inject({servo: servo});
servo.cw();
console.log("loaded");
}); //End of board.on function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment