// Make Controller Kit - LEDControl // Toggle the Application Board LEDs on a mouse press // based on oscP5message by andreas schlegel import oscP5.*; import netP5.*; OscP5 oscP5; NetAddress makeControllerAddress; int toggleState; void setup() { size( 400, 400 ); frameRate( 25 ); // start oscP5, listening for incoming messages at port 10000 oscP5 = new OscP5( this, 10000 ); // set the address of the board we're sending to... makeControllerAddress = new NetAddress("192.168.0.200", 10000); toggleState = 1; } void draw() { background(0); } void mousePressed() { // create a new OSC message OscMessage myMessage = new OscMessage("/appled/0/state"); myMessage.add( toggleState ); // add an argument to the message oscP5.send( myMessage, makeControllerAddress ); // send the message // toggle the state of the LED and save it for next time if( toggleState == 1 ) toggleState = 0; else toggleState = 1; }