Arduino Uno OSC to MadMapper help needed (PIR Sensor project)

Hi all,

Brand new to Arduino and been doing a crash course in a week to get a work project going. This is for an LED RGB fixture wall project in a hospital I designed. Eventually this code will control 3 PIR motion sensors where the HIGH signal will make an OSC Message go from the Arduino to a media laptop server to trigger a video clip. But first things first, I’m just trying to successfully get the Arduino to trigger a clip with an OSC command. I believe I’m using the OSCuino library.

This code is based on Headroom’s Arduino/TouchOSC tutorial on trippylighting.com but I’ve substituted my own OSC Message attempting to connect to MadMapper on my laptop. I believe the Ethernet and UDP settings are correct because I was able to get connectivity with TouchOSC on my iPhone going with the tutorial. I left all that code in the void set-up.

I’ve tried using both 1.0 and 0.0 for my float and made several attempts to map it to different parameters to no avail.

Is anyone able to make any sense of this? Code is below and thanks in advance.

//DHCP-based OSC server test code
//for use with IDE 1.0.5
//for use with W5100 or W5200 based ethernet shields

#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <OSCBundle.h>
#include <OSCMessage.h>

// you can find this written on the board of some Arduino Ethernets or shields
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; 

// NOTE: Alternatively, you can assign a fixed IP to configure your
//       Ethernet shield.
//       byte ip[] = { 192, 168, 0, 154 };


int serverPort  = 8010; //MadMapper (incoming port)
int destPort = 9000;    //MadMapper (outgoing port)


//Create UDP message object
EthernetUDP Udp;

void setup(){
  Serial.begin(9600); //9600 for a "normal" Arduino board (Uno for example). 115200 for a Teensy ++2 
  Serial.println("OSC test");

  // start the Ethernet connection:
  // NOTE: Alternatively, you can assign a fixed IP to configure your
  //       Ethernet shield.
  //       Ethernet.begin(mac, ip);   
  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("."); 
  }

  Udp.begin(serverPort);
}

void loop(){

 
  OSCMessage msg("/1/toggle2");
  msg.add(1.0);

  Udp.beginPacket(Udp.remoteIP(), destPort);
  msg.send(Udp); // send the bytes
  Udp.endPacket(); // mark the end of the OSC Packet
  msg.empty(); // free space occupied by message

  delay(1000);

 }