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("../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 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("johnny-five"), | |
Spark = require("spark-io"), | |
board, sensor; | |
// 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 | |
}) |
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 piezo = new five.Piezo(); | |
var joyToWorld = { | |
song: [ | |
["C5", 1], | |
["B4", 3/4], | |
["A4", 1/4], |
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("spark-io"), | |
board = new five.Board({ | |
io: new Spark({ | |
token: process.env.SPARK_TOKEN, | |
deviceId: process.env.SPARK_DEVICE_ID | |
}) | |
}); | |
// The board's pins will not be accessible until |
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("spark-io"), | |
board = new five.Board({ | |
io: new Spark({ | |
token: process.env.SPARK_TOKEN, | |
deviceId: process.env.SPARK_DEVICE_ID | |
}) | |
}); | |
// The board's pins will not be accessible until |
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"); | |
new five.Board().on("ready", function() { | |
console.log("CONNECTED"); | |
var led = new five.Led.RGB([3,5,6]); | |
led.on(); | |
setTimeout(function() { |
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("spark-io"), | |
board = new five.Board({ | |
io: new Spark({ | |
token: process.env.SPARK_TOKEN, | |
deviceId: process.env.SPARK_DEVICE_ID | |
}) | |
}); | |
// The board's pins will not be accessible until |
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
#!/usr/bin/env node | |
'use strict' | |
var say = require('say'), | |
toSay = process.argv[2] || "Hello World", | |
voices = [ | |
"Agnes", | |
"Kathy", | |
"Princess", |