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 cylon = require('cylon'); | |
cylon.robot({ | |
connection: { | |
name: 'voodoospark', | |
adaptor: 'voodoospark', | |
accessToken: process.env.SPARK_TOKEN, | |
deviceId: process.env.SPARK_DEVICE_ID, | |
module: 'spark' | |
}, |
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("../lib/johnny-five.js"), | |
board = new five.Board(); | |
board.on("ready", function() { | |
// Creates a piezo object and defines the pin to be used for the signal | |
var piezo = new five.Piezo(process.argv[2] || 3); | |
// Injects the piezo into the repl | |
board.repl.inject({ | |
piezo: piezo |
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("../lib/johnny-five.js"), | |
board = new five.Board(); | |
board.on("ready", function() { | |
// Creates a piezo object and defines the pin to be used for the signal | |
var piezo = new five.Piezo(3); | |
// Injects the piezo into the repl | |
board.repl.inject({ | |
piezo: piezo |
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"), | |
board = new five.Board(), | |
led; | |
var demoSequence = [{ | |
method: "pulse", | |
args: [1000], | |
duration: 5000 | |
}, { |
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"); | |
five.Board().on("ready", function() { | |
// Defaults to pin 11 (must be PWM) | |
var led = new five.Led(process.argv[2] || 11); | |
// Pulse the LED every half second | |
console.log("led.pulse(500)"); | |
led.pulse(500); |
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"); | |
five.Board().on("ready", function() { | |
// Defaults to pin 13 | |
var led = new five.Led(process.argv[2] || 13); | |
// Turn on the LED | |
console.log("led.on()"); | |
led.on(); |
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"), | |
keypress = require("keypress"); | |
var step = 0; | |
var demoSequence = [{ | |
method: "pulse", | |
args: [1000] | |
}, { | |
method: "strobe", | |
args: [500] |
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"); | |
five.Board().on("ready", function() { | |
// Defaults to pin 11 (must be PWM) | |
var led = new five.Led(11); | |
var rgb = new five.Led.RGB([3,5,6]); | |
led.pulse(); | |
rgb.pulse(); |
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"); | |
five.Board().on("ready", function() { | |
var led = new five.Led.RGB({ | |
pins: { | |
red: 3, | |
green: 5, | |
blue: 6 | |
} |