When trying to re-compile a code example that uses the ArdOSC library I noticed that ArdOSC does not seem part of Teensyduino anymore.
Are there any reasons that ArdOSC should not work anymore ?
Of course the example code how it works in conjunction with TouchOSC will come with the "next" release which I am sure will be out "soon" (Grrrr).
BTW ArdOSC works fine on a Teensy++2 using WIZ812MJ Ethernet Module (with W5100) and I've got it to work with a WIZ820io as well.
I am trying to get some older examples moved to the Teensy3. It would really be nice not having to re-write stuff ;-)
My code involving ArdOSC compiles fine if I select a Teensy++2 in Tools->Board. When I select a Teensy3 the Arduino IDE complains about the following:
here is the short Arduino demo sketch that I am trying to compile on a Teensy3:
Are there any reasons that ArdOSC should not work anymore ?
Of course the example code how it works in conjunction with TouchOSC will come with the "next" release which I am sure will be out "soon" (Grrrr).
BTW ArdOSC works fine on a Teensy++2 using WIZ812MJ Ethernet Module (with W5100) and I've got it to work with a WIZ820io as well.
I am trying to get some older examples moved to the Teensy3. It would really be nice not having to re-write stuff ;-)
My code involving ArdOSC compiles fine if I select a Teensy++2 in Tools->Board. When I select a Teensy3 the Arduino IDE complains about the following:
Code:
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.0"
In file included from /Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCCommon/OSCClient.h:21:0,
from /Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/ArdOSC.h:55,
from Ethernet_ArdOSC.ino:4:
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCCommon/OSCEncoder.h:27:33: error: 'OSCMessage::OSCMessage' is not a type
In file included from /Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/ArdOSC.h:55:0,
from Ethernet_ArdOSC.ino:4:
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCCommon/OSCClient.h:36:5: error: 'OSCEncoder::OSCEncoder' names the constructor, not the type
In file included from /Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCCommon/OSCServer.h:19:0,
from /Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/ArdOSC.h:56,
from Ethernet_ArdOSC.ino:4:
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCCommon/OSCDecoder.h:26:30: error: 'OSCMessage::OSCMessage' is not a type
In file included from /Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/ArdOSC.h:56:0,
from Ethernet_ArdOSC.ino:4:
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCCommon/OSCServer.h:31:5: error: 'OSCDecoder::OSCDecoder' names the constructor, not the type
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCCommon/OSCServer.h:32:5: error: 'Pattern::Pattern' names the constructor, not the type
here is the short Arduino demo sketch that I am trying to compile on a Teensy3:
Code:
#include <SPI.h>
#include <Ethernet.h>
#include <ArdOSC.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
OSCServer server;
OSCClient client;
int serverPort = 8000; //Touch OSC Port (outgoing)
int destPort = 9000; //Touch OSC Port (incoming)
int ledPin = 13; //6 on a Teensy++2
int flag=0;
void setup(){
Serial.begin(115200);
Serial.println("DNS and DHCP-based OSC server");
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
// print your local IP address:
Serial.print("Arduino IP address: ");
for (byte thisByte = 0; thisByte < 4; thisByte++) {
// print the value of each byte of the IP address:
Serial.print(Ethernet.localIP()[thisByte], DEC);
Serial.print(".");
}
Serial.println();
Serial.println();
//start the OSCserver
server.begin(serverPort);
//add OSC callback function. One function is needed for every TouchOSC interface element that will send/receive OSC commands.
server.addCallback("/Eth_ArdOSC/toggle1", &funcOnOff);
}
void loop(){
if(server.aviableCheck()>0){
Serial.println("alive! ");
}
}
//When the button on the TouchOSC interface is pressed, a message is sent from the iDevice
//to the Arduino to switch (toggle) the LED on the Arduino on/off
//then a messeage is sent back from the Arduino to the iDevice to toggle the buttom on/off
void funcOnOff(OSCMessage *_mes){
float value = _mes->getArgFloat(0); //TouchOSC expects float values
//create new osc message
OSCMessage newMes;
//set destination ip address & port no
newMes.setAddress(_mes->getIpAddress(),destPort);
newMes.beginMessage("/Eth_ArdOSC/toggle1");
if(flag==1){
flag=0;
Serial.println(value);
digitalWrite(ledPin, LOW);
}
else{
flag=1;
Serial.println(value);
digitalWrite(ledPin, HIGH);
}
newMes.addArgFloat(flag);
//send osc message
client.send(&newMes);
}
Last edited: