Poll
Question: 3r234
qe3w - 1 (50%)
13 - 1 (50%)
Total Voters: 2

Pages: [1]   Go Down
Author Topic: processing+iphone+touchosc= arduino controlled by iphone!:)  (Read 582 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i dont know, what was wrong with this code!:(
import oscP5.*;
import netP5.*;

OscP5 oscP5;
float redAmount = 0.0f;
float greenAmount = 0.0f;
float blueAmount = 0.0f;



void setup(){
  size(320,480);
  background(0);
  oscP5 = new OscP5(this, 8000);
}
 void draw(){
   background(redAmount, greenAmount, blueAmount);
   fill(0);
   stroke(255,0,0);
   rect(34,39,67,255);
   fill(50,40,40);
   rect(34,39+255,67,-redAmount);
   
   fill(0);
    stroke(0,255,0);
   rect(124,39,67,255);
   fill(40,50,40);
   rect(124,39+255,67,-greenAmount);
   
   fill(0);
    stroke(0,0,255);
   rect(216,39,67,255);
   fill(40,40,50);
   rect(216,39+255,67,-blueAmount);
 }
 
void oscEvent(OscMessage theOscMessage){
  String addr = theOscMessage.addrPattern();
  float val = theOscMessage.get(0).floatValue();
 
  if(addr.equals("/1/red")){ redAmount = val;}
  if(addr.equals("/1/green")){ greenAmount = val;}
  if(addr.equals("/1/blue")){ blueAmount = val;}

 
}

help me please
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25800
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Neither do I, except it is badly posted.
Please use code tags.
And lose the poll
« Last Edit: May 18, 2012, 04:05:08 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1]   Go Up
Jump to: