Created
June 6, 2014 01:49
-
-
Save Resseguie/41e41d2f8ab884930474 to your computer and use it in GitHub Desktop.
Demonstration of PWM on 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() { | |
var led = new five.Led(process.argv[2] || "A0"); | |
this.repl.inject({ | |
led: led | |
}); | |
led.fadeIn(); | |
this.wait(3000,function(){ | |
led.fadeOut(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment