This file contains hidden or 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
//trafficsignal.js | |
var five = require("johnny-five"); | |
var board = new five.Board(); | |
//Arduino board connection | |
board.on("ready", function() { |
This file contains hidden or 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
//trackswitch.js | |
var five = require("johnny-five"); | |
var board = new five.Board(); | |
//Arduino board connection | |
board.on("ready", function() { |
This file contains hidden or 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
// traincrossing.js | |
// Dependencies | |
var five = require("johnny-five"); | |
var board = new five.Board(); | |
// Arduino board connection | |
board.on("ready", function() { | |
// Train Crossing Components |
This file contains hidden or 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
// citystation.js | |
// Dependencies | |
var five = require('johnny-five'); | |
var raspi = require("raspi-io"); | |
var board = new five.Board({ | |
io: new raspi() | |
}); | |
This file contains hidden or 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
// energysave.js | |
// www.internetoflego.com | |
// Dependencies | |
var five = require("johnny-five"); | |
var board = new five.Board(); | |
// Arduino board connection | |
board.on("ready", function() { |
This file contains hidden or 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
// server.js | |
// This program creates the server for controlling Arduino or similar projects. | |
// You can either use a web socket for real-time communication, or GET requests to send commands easily. | |
// Refer to the following "elevator.js" file for a working circuit file that accepts the commands. | |
// https://gist.github.com/dexterlabora/4a4692d0954eab107dd2 | |
// More info at www.internetoflego.com | |
// includes | |
var Primus = require('primus'); |
This file contains hidden or 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
// elevator.js | |
// This program will use an Adafruit motor shield v1 (http://www.adafruit.com/products/81) clone to power a small 5v motor | |
// and an ultrasonic sensor for positioning | |
// The ultrasonic sensor requires PingFirmata on the Arduino (http://johnny-five.io/api/proximity/#pingfirmata) | |
// Dependencies | |
var five = require('johnny-five'); | |
var board = new five.Board(); |
This file contains hidden or 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
// server-pubnub.js | |
// www.InternetOfLego.com | |
// This app provides a multi-functional server for which a "circuit file" is spawned from the process. | |
// Child process communication example: circuit.send({'command': 'led_on'}); | |
// The server provides support for the following communication options | |
// RESTful API using express example: http://192.168.0.15:8080/command/led_on) | |
// Websocket using Primus example: spark.send('command', 'led_on') | |
// Messaging using PubNub example: pubnub.publish({channel :'iol', message : {"command":"led_on"}}) |
This file contains hidden or 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
// circuit-master.js | |
// This program uses multiple microcontrollers in the same app to control a living Lego city. | |
// ~~ IoL City ~~ | |
// www.InternetOfLego.com | |
// ~~~~ CIRCUIT ~~~~~~~ | |
// Includes | |
var five = require('johnny-five'); | |
var Raspi = require("raspi-io"); |
This file contains hidden or 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
[{"id":"a0f49a5c.5f0b68","type":"pubnub-keys","pub_key":"XXXX","sub_key":"XXXX"},{"id":"490810ab.b6f7f","type":"pubnub in","keys":"a0f49a5c.5f0b68","channel":"iol","x":94,"y":86,"z":"11e87d2f.ee1783","wires":[["1e0d1490.e1f2eb","1bd186c1.e42e79"]]},{"id":"965d4cc1.69a2b","type":"pubnub out","keys":"a0f49a5c.5f0b68","channel":"iol","x":656,"y":405,"z":"11e87d2f.ee1783","wires":[]},{"id":"1e0d1490.e1f2eb","type":"debug","name":"PubNub raw data","active":false,"console":"false","complete":"payload","x":337,"y":44,"z":"11e87d2f.ee1783","wires":[]},{"id":"e91c1b55.16e3e8","type":"inject","name":"","topic":"","payload":"From node-red, Hello World!","payloadType":"none","repeat":"","crontab":"","once":false,"x":140,"y":301,"z":"11e87d2f.ee1783","wires":[["20132ddb.dfecd2"]]},{"id":"fe4f5cf0.01b0a","type":"inject","name":"","topic":"","payload":"{command:lights_off}","payloadType":"none","repeat":"","crontab":"","once":false,"x":142,"y":365,"z":"11e87d2f.ee1783","wires":[["40213340.bfdecc"]]},{"id":"20132ddb.dfecd2", |
OlderNewer