Video:
sorry the video is kinda odd because my camera is trying to adjusting for the light difference.
Remove these ads by
Signing UpStep 1The parts
-NPN transistor
-Iphone/ Android(Using Iphone)
- The TouchOSC app (awesome app)
-Arduino 5v (any type)
-some wire
-Soldering iron
-Breadboard (optional but recommended)
- A Mac or PC
-Some sort of remote or low power button (anything that runs on AA,AAA batteries is usually fine)
-If you want to control a appliance look at the last step fore more info.
and thats it!
| « Previous Step | Download PDFView All Steps | Next Step » |















































You don't need to remove the jar from the folder.
2. You will need to download the oscP5 library for processing
Go here and download the library. Extract the files and move the folder oscP5 to this directory {C:\Users\[your user name]\Documents\Processing\libraries\[put the folder here]}
?
And after inserting you need to turn off all processing windows and rerun it :)
import processing.serial.*;
import oscP5.*;
import netP5.*;
OscP5 oscP5;
int alphaValue;
Serial arduinoPort;
float v_push1 = 0.0f;
float v_push2 = 0.0f;
float v_push3 = 0.0f;
float v_push4 = 0.0f;
void setup() {
size(320,440);
frameRate(25);
arduinoPort = new Serial(this, "COM1", 9600);//change to the serial port arduino is on
/* start oscP5, listening for incoming messages at port 8000 */
oscP5 = new OscP5(this,8000);
}
void oscEvent(OscMessage theOscMessage) {
String addr = theOscMessage.addrPattern();
float val = theOscMessage.get(0).floatValue();
if(addr.equals("/1/push1")) { v_push1 = val; }
else if(addr.equals("/1/push2")) { v_push2 = val; }
else if(addr.equals("/1/push3")) { v_push3 = val; }
else if(addr.equals("/1/push4")) { v_push4 = val; }
}
void draw() {
background(0);
// fader5 + push 1-4 outlines
fill(0);
stroke(0, 196, 168);
rect(17,21,287,55);
rect(17,369,60,50);
rect(92,369,60,50);
rect(168,369,60,50);
rect(244,369,60,50);
// fader5 + push 1-4 fills
fill(0, 196, 168);
if(v_push1 == 1.0f) rect(22,374,50,40);
if(v_push2 == 1.0f) rect(97,374,50,40);
if(v_push3 == 1.0f) rect(173,374,50,40);
if(v_push4 == 1.0f) rect(249,374,50,40);
if(v_push1 == 1.0f) arduinoPort.write("U");
if(v_push1 == 0.0f) arduinoPort.write("u");
if(v_push2 == 1.0f) arduinoPort.write("D");
if(v_push2 == 0.0f) arduinoPort.write("d");
if(v_push3 == 1.0f) arduinoPort.write("L");
if(v_push3 == 0.0f) arduinoPort.write("l");
if(v_push4 == 1.0f) arduinoPort.write("R");
if(v_push4 == 0.0f) arduinoPort.write("r");
as I see the rest is missing.
import processing.serial.*;
import oscP5.*;
import netP5.*;
OscP5 oscP5;
int alphaValue;
Serial arduinoPort;
float v_push1 = 0.0f;
float v_push2 = 0.0f;
float v_push3 = 0.0f;
float v_push4 = 0.0f;
void setup() {
size(320,440);
frameRate(25);
arduinoPort = new Serial(this, "COM1", 9600);//change to the serial port arduino is on
/* start oscP5, listening for incoming messages at port 8000 */
oscP5 = new OscP5(this,8000);
}
void oscEvent(OscMessage theOscMessage) {
String addr = theOscMessage.addrPattern();
float val = theOscMessage.get(0).floatValue();
if(addr.equals("/1/push1")) { v_push1 = val; }
else if(addr.equals("/1/push2")) { v_push2 = val; }
else if(addr.equals("/1/push3")) { v_push3 = val; }
else if(addr.equals("/1/push4")) { v_push4 = val; }
}
void draw() {
background(0);
// fader5 + push 1-4 outlines
fill(0);
stroke(0, 196, 168);
rect(17,21,287,55);
rect(17,369,60,50);
rect(92,369,60,50);
rect(168,369,60,50);
rect(244,369,60,50);
// fader5 + push 1-4 fills
fill(0, 196, 168);
if(v_push1 == 1.0f) rect(22,374,50,40);
if(v_push2 == 1.0f) rect(97,374,50,40);
if(v_push3 == 1.0f) rect(173,374,50,40);
if(v_push4 == 1.0f) rect(249,374,50,40);
if(v_push1 == 1.0f) arduinoPort.write("U");
if(v_push1 == 0.0f) arduinoPort.write("u");
if(v_push2 == 1.0f) arduinoPort.write("D");
if(v_push2 == 0.0f) arduinoPort.write("d");
if(v_push3 == 1.0f) arduinoPort.write("L");
if(v_push3 == 0.0f) arduinoPort.write("l");
if(v_push4 == 1.0f) arduinoPort.write("R");
if(v_push4 == 0.0f) arduinoPort.write("r");
}
http://www.youtube.com/watch?v=lX-VxmEOtIM
Great writeup! Does this require a PC connection to the phone? I mean, after everything is configured and done, do you still need the PC on to operate the arduino?
Thanks alot!
Shane
found this video of it on youtube: http://www.youtube.com/watch?v=lX-VxmEOtIM
1.go to your router configuration and forward the ports 8000 and 9000
2. if you do not have a static ip already (you likely have a dynamic IP) go to http://www.dyndns.com/services/dns/dyndns/ and install it and copy down the ip it gives you
3.In touchOSC input the ip you found in the last step in the network configuration setting for hostname
4. run it normally
ive been playing around with the program, how would i get it to just do a digital output? i don't have transistors on me.