Created
June 6, 2014 03:00
-
-
Save Resseguie/4d4e867c54ae7bb452e0 to your computer and use it in GitHub Desktop.
demonstrate servo on Spark A0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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