// Make Controller Kit - Analog In // Send out 'read' messages every frame, and then grab the message coming back from the board. // based on oscP5message by andreas schlegel import oscP5.*; import netP5.*; OscP5 oscP5; NetAddress makeControllerAddress; OscMessage myMessage; int trimpot; void setup() { size(400,400); frameRate(25); //start oscP5, listening for incoming messages at port 10000 oscP5 = new OscP5(this, 10000); makeControllerAddress = new NetAddress( "192.168.0.200", 10000 ); myMessage = new OscMessage("/analogin/7/value"); trimpot = 0; } void draw() { background(25); oscP5.send(myMessage, makeControllerAddress); // send the message // use the trimpot value to size the circles fill( 240 ); ellipse( 100, 100, trimpot/2, trimpot/2 ); fill( 150 ); ellipse( 250, 250, trimpot/4, trimpot/4 ); } // this gets called back whenever there's a new OSC message coming back from the board. void oscEvent(OscMessage theOscMessage) { // compare the incoming address to the address we asked for. if( theOscMessage.addrpattern().equals( "/analogin/7/value" ) ) trimpot = theOscMessage.get(0).intValue(); }