Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How can i transfer data between Android and PC using OSC?

$
0
0

Hello everybody!

I want to create an app for android that sends the values of the accelerometer to a PC, and i decided to use oscP5 to connect both devices. But i just tried to send a message from my smartphone to see if it works but anything happends. Wich IP i should put in myRemoteLocation? Because i tried using an app called Control (http://charlie-roberts.com/Control/) and worked with the IPv4 adress of my router wifi, but when i run my program in the PC the console says:

[2015/9/6 18:14:9] INFO @ OscP5 is running. you (25.171.19.114) are listening @ port 12000

Thanks you very much!

//-------------- ANDROID SKETCH ---------------

import netP5.*;
import oscP5.*;

OscP5 oscAnd;
NetAddress myRemoteLocation;

void setup() {
  size(displayWidth, displayHeight);
  oscAnd = new OscP5(this, 12001); 
  myRemoteLocation = new NetAddress("172.16.0.13", 12000);     
}

 void mousePressed() {
   OscMessage EnviarMensaje1 = new OscMessage ("/testing");
   oscAnd.send(EnviarMensaje1, myRemoteLocation);
 }

//-------------- PC SKETCH ----------------

import oscP5.*;
import netP5.*;

OscP5 oscPC;

void setup() {
 oscPC = new OscP5(this, 12000); 
 size(400 , 400);
}


void oscEvent (OscMessage m) {
  println(m.addrPattern());
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles