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
/* | |
Pins, 13-11 connected to relays | |
serial input 1-3 to toggle relay on for 2 seconds | |
from Tom Igoe's RGB Serial example | |
This example code is in the public domain. | |
*/ | |
// pins for the LEDs: | |
const int pinA = 13; |
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
<!-- Copy this into your HTML file right aboove </body> --> | |
<!-- load jquery from cdn --> | |
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script> | |
<!-- STEP 1 - load mespeak from your webserver UPDATE PATH. Download here http://www.masswerk.at/mespeak --> | |
<script type='text/javascript' src='http://www.productiondesign.nl/yt_player_mespeak/js/mespeak/mespeak.js'></script> | |
<script type='text/javascript'> | |
// STEP 2 - config mespeak you will need two files |
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
const int cloudModulePin = 2; // switch input from cloud module JST connector <-----> Arduino pin 2 | |
const int motor1Pin = 6; // H-bridge pin 2 <-----> Arduino pin 6 | |
const int motor2Pin = 7; // H-bridge pin 7 <-----> Arduino pin 7 | |
// note - arduino and JST connector share common ground | |
void setup() { | |
// set the switch as an input: | |
pinMode(cloudModulePin, INPUT); |
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
import struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
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
import struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
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
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
This example code is in the public domain. | |
*/ | |
// Pin 13 has an LED connected on most Arduino boards. | |
// give it a name: | |
int relay1 = 13; // pin 13 |
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
Titanium.Facebook.sessionForAccessToken = function(callback) { | |
var app_id = '<APP_ID>'; | |
var app_secret = '<APP_SECRET>'; | |
xhr.onerror = function(e) | |
{ | |
Ti.API.info('Unable to exchange session for OAuth access_token ' + e.error); | |
callback(false); | |
}; | |
xhr.setTimeout(10000); |
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 net = require('net'); | |
var guestsA = []; | |
var guestsB = []; | |
var serverA = net.createServer(function (socket) { | |
//socket.write("Echo server\r\n"); | |
//socket.pipe(socket); | |
}); | |
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
/* | |
Button | |
Turns on and off a light emitting diode(LED) connected to digital | |
pin 13, when pressing a pushbutton attached to pin 2. | |
The circuit: | |
* LED attached from pin 13 to ground | |
* pushbutton attached to pin 2 from +5V |
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
// Detect a Switch | |
// Example to detect a switch press | |
// Developed for the Developing Assistive Technology class | |
int switchPin = 2; | |
int switchValue = 0; | |
int ledPin = 13; | |
int counter = 0; |
OlderNewer