Last active
August 29, 2015 14:00
-
-
Save rwaldron/11263518 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Initialize the port for output: | |
echo -n "3" > /sys/class/gpio/export | |
echo "out" > /sys/class/gpio/gpio3/direction | |
# Turn the on-board Led on: | |
echo "1" > /sys/class/gpio/gpio3/value | |
# Now turn it off: | |
echo "0" > /sys/class/gpio/gpio3/value |
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 Board = require("firmata").Board; | |
var board = new Board("/dev/path-to-device"); | |
board.on("ready", function() { | |
var byte = 1; | |
var pin = 13; | |
this.pinMode(pin, this.MODES.OUTPUT); | |
setInterval(function() { | |
this.digitalWrite(pin, (byte ^= 1)); | |
}.bind(this), 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
// This file executes ON the board!! | |
var Galileo = require("galileo"); | |
var board = new Galileo(); | |
board.on("ready", function() { | |
var byte = 1; | |
var pin = 13; | |
this.pinMode(pin, this.MODES.OUTPUT); | |
setInterval(function() { | |
this.digitalWrite(pin, (byte ^= 1)); | |
}.bind(this), 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
// This file executes ON the board!! | |
var five = require("johnny-five"); | |
var Galileo = require("galileo"); | |
var board = five.Board({ | |
io: new Galileo() | |
}); | |
board.on("ready", function() { | |
new five.Led(13).blink(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
// This file executes ON the board!! | |
var five = require("johnny-five"); | |
var board = five.Board(); | |
board.on("ready", function() { | |
new five.Led(13).blink(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"); | |
var board = five.Board(); | |
board.on("ready", function() { | |
new five.Led(13).blink(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"); | |
var board = new five.Board(); | |
board.on("ready", 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
// This file executes ON the board!! | |
var Plugin = require("plugin-io"); | |
var board = new Plugin(); | |
board.on("ready", function() { | |
var byte = 1; | |
var pin = 13; | |
this.pinMode(pin, this.MODES.OUTPUT); | |
setInterval(function() { | |
this.digitalWrite(pin, (byte ^= 1)); | |
}.bind(this), 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"); | |
var Plugin = require("plugin-io"); | |
var board = new five.Board({ | |
io: new Plugin() | |
}); | |
board.on("ready", function() { | |
// ... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment