I am using the OSCbundle.h library to receive OSC messages on a Teensy 3.x(Arduino) from TouchOSC.
Once the OSC message ahas been recieved, there is (often) a return message that sends feedback back to the TouchOSC interface, that is typically called like:
OSCMessage msgOUT("/2/toggle1");
where "/2/off1" is the destination "address" of the message.
I am trying to replace the literal "/2/toggle1", with a variable. Currently I am using a String variable type name 'title' to contain the destination address, however I am unable to use:
OSCMessage msgOUT(title);
The above results in the following error: "no matching function for call to 'OSCMessage::OSCMessage(String&)'"
If I try using other variable formats, such as uint8_t, I get:
"call of overloaded 'OSCMessage(uint8_t&)' is ambiguous"
I have tried converting the String to various other variable types, but so far I have not figured out a type or format that works to replace the literal.
Any ideas?
Here is the full code of the function:
void transmit(byte cmd, byte mtr, byte spd, byte otr, int value, String title){
Serial.print("title:");
Serial.println(title);
Wire.beginTransmission(0x44); // transmit to device #8
Wire.write( cmd ); // sends one byte
Wire.write( mtr );
Wire.write( spd );
Wire.write( otr );
Wire.endTransmission(); // stop transmitting
print_i2c_status(); // print I2C final status
OSCMessage msgOUT("/2/off1");
msgOUT.add(value);
Udp.beginPacket(Udp.remoteIP(), destPort);
msgOUT.send(Udp); // send the bytes
Udp.endPacket(); // mark the end of the OSC Packet
msgOUT.empty(); // free space occupied by message
}