I have downloaded hairless-midiserial but i am unsure how to use it with resolume and my touch sensor
any help would be really appreciative as im stuck for time, thanks.
this is my code for arduino:
Code: Select all
#include <Boards.h>
#include <Firmata.h>
#include <CapacitiveSensor.h>
CapacitiveSensor cs_2_4 = CapacitiveSensor(2,4);
void setup()
{
Serial.begin(9600); }
void loop()
{ long start = millis();
long total5 = cs_2_4.capacitiveSensor(30);
Serial.print(millis() - start); // check on performance in milliseconds
Serial.print("\t"); // tab character for debug windown spacing
Serial.println(total5); // print sensor output 1
// print sensor output 3
delay(100); // arbitrary delay to limit data to serial port
}
Code: Select all
import processing.serial.*;
Serial myPort; // Create object from Serial class
String val; // Data received from the serial port
void setup() { size(400,400); myPort = new Serial(this, "/dev/tty.usbmodem1421", 9600); }
void draw()
{ if ( myPort.available() > 0)
{ // If data is available,
val = myPort.readStringUntil('\n'); // read it and store it in val
}
println(val); //print it out in the console
}