Hi, guys!
I'm using Arduino Yun and I want to send message to Processing
through wifi using by osc library made by CNMAT.
Code: [Select]
#include <OSCMessage.h>
/*
Make an OSC message and send it over serial
*/
#ifdef BOARD_HAS_USB_SERIAL
#include <SLIPEncodedUSBSerial.h>
SLIPEncodedUSBSerial SLIPSerial( thisBoardsSerialUSB );
#else
#include <SLIPEncodedSerial.h>
SLIPEncodedSerial SLIPSerial(Serial1);
#endif
void setup() {
//begin SLIPSerial just like Serial
SLIPSerial.begin(9600); // set this as high as you can reliably run on your platform
#if ARDUINO >= 100
while(!Serial)
; //Leonardo "feature"
#endif
}
void loop(){
//the message wants an OSC address as first argument
OSCMessage msg("/analog/0");
msg.add((int32_t)analogRead(0));
SLIPSerial.beginPacket();
msg.send(SLIPSerial); // send the bytes to the SLIP stream
SLIPSerial.endPacket(); // mark the end of the OSC Packet
msg.empty(); // free space occupied by message
delay(20);
}
I want to send a message to Processing using by this sample as a guide , but I do not know how to specify the IP address .How do you send a message by specifying the IP address of the Processing side ?
help me!