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
#include "ofApp.h" | |
ofApp *ofApp::_app = 0; | |
ofApp::ofApp() { _app = this; } | |
void ofApp::setup() { | |
} |
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 socket = io.connect(); | |
var connected = false; | |
var connectionId = ''; | |
socket.on('init', function (data) { | |
if (data.status == 'ready') { | |
connected = true; | |
connectionId = data.clientId; | |
document.getElementById('debug').innerHTML = 'Connected: ID ' + connectionId; |
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
#include <Streaming.h> | |
#include <Servo.h> | |
#include <Adafruit_NeoPixel.h> | |
Servo servo; // D9 | |
Adafruit_NeoPixel leds = Adafruit_NeoPixel(15, 7, NEO_GRB + NEO_KHZ800); | |
unsigned long millisServo = 0; | |
unsigned long millisLed = 0; | |
unsigned long millisLedFade = 0; |
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 codeanticode.syphon.*; | |
OPC opc; | |
SyphonClient client; | |
PImage dot; | |
PImage img; | |
void setup() { | |
size(640, 360, P3D); | |
client = new SyphonClient(this); |
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
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max) { | |
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} |
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
#include <Streaming.h> | |
#include <Adafruit_NeoPixel.h> | |
#define BAUD 9600 | |
#define LEDPIN 9 | |
long pMillis = 0; | |
long interval = 5; | |
int fadeCallback = 0; |
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
#include "ofApp.h" | |
void ofApp::setup(){ | |
ofSetEscapeQuitsApp(false); | |
} |
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
#include "DIMager.h" | |
DIMager::DIMager() { | |
motionSensor = IMotionSensor::createCameraSensor(); | |
if (!motionSensor) cout << "Camera not found." << endl; | |
sensor = motionSensor->getSensor(); | |
if(!sensor->isAlive()) cout << "Failed to initialize." << endl; | |
motionSensor->setVerbosityLevel(3, "log4cxx.cfg"); |
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
void ofFrameRect(ofRectangle r, float lw, bool innerStroke = true) { | |
ofNoFill(); | |
ofSetLineWidth(lw); | |
lw = ((innerStroke) ? -1 : 1) * lw / 2; | |
ofLine(r.x, r.y, r.x + r.width, r.y); | |
ofLine(r.x + r.width + lw, r.y, r.x + r.width + lw, r.y + r.height); | |
ofLine(r.x + r.width + lw, r.y + r.height + lw, r.x, r.y + r.height + lw); | |
ofLine(r.x + lw, r.y + r.height, r.x + lw, r.y + lw); | |
} |
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
#include <Streaming.h> | |
const int r = 3; // R PIN | |
const int g = 5; // G PIN | |
const int b = 6; // B PIN | |
const int leds[] = {r, g, b}; // RGB PINS | |
const int photoCellL = A0; // LEFT PHOTOCELL | |
const int photoCellR = A1; // RIGHT PHOTOCELL |
NewerOlder