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
/* | |
* Firmata is a generic protocol for communicating with microcontrollers | |
* from software on a host computer. It is intended to work with | |
* any host computer software package. | |
* | |
* To download a host software package, please clink on the following link | |
* to open the download page in your default browser. | |
* | |
* http://firmata.org/wiki/Download | |
*/ |
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
import SimpleOpenNI.*; | |
import ddf.minim.*; | |
SimpleOpenNI kinect; | |
Minim minim; | |
AudioSnippet player1; | |
AudioSnippet player2; | |
AudioSnippet player3; | |
AudioSnippet player4; |
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
import SimpleOpenNI.*; | |
SimpleOpenNI context; | |
void setup() | |
{ | |
context = new SimpleOpenNI(this); | |
// mirror is by default enabled |
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
var http = require('http'), | |
five = require('johnny-five'), | |
feedID = 35602, //30041, //87256 | |
apiKey = '1Og9wAmRBoWExjjN4LdksinNYIaSAKxVYVo0RHlHcHcvUT0g', | |
value, | |
oldValue, | |
board, | |
servo; | |
// Build get request for cosm api |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>photoresistor</title> | |
<style media="screen"> | |
html, body{ | |
min-height: 100%; | |
} |
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
var app = require('http').createServer(handler), | |
io = require('socket.io').listen(app), | |
fs = require('fs'), | |
five = require('johnny-five'), | |
board, | |
photoresistor; | |
app.listen(8000); | |
// function for serving the static HTML page |
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
var five = require("johnny-five"), | |
board, led; | |
board = new five.Board(); | |
board.on("ready", function() { | |
// Create a standard `led` hardware instance | |
led = new five.Led(9); |
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
var five = require("johnny-five"), | |
board = new five.Board(); | |
board.on("ready", function() { | |
// Create an Led on pin 9 and strobe it on/off | |
// Optionally set the speed; defaults to 100ms | |
(new five.Led(9)).strobe(); | |
}); |
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
// These constants won't change. They're used to give names | |
// to the pins used: | |
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
const int greenOutPin = 9; // Analog output pin that the green LED is attached to | |
const int yellowOutPin = 10; // Analog output pin that the ylw LED is attached to | |
const int redOutPin = 11; // Analog output pin that the red LED is attached to | |
int sensorValue = 0; // value read from the pot | |
int outputValue = 0; // value output to the PWM (analog out) |
NewerOlder