I’m using shiftr to receive data into processing and I want to send it to Arduino. I’ve stored 8 values into an array and sent it to Arduino as a string. I’m having trouble with receiving the string in Arduino from processing and storing it into 8 separate values to use with a sensor.
each value is a 1 or 0
processing code:
void draw() {
background(0);
int[] touchSensor = new int[8];
touchSensor[0]= Jtouch1;
touchSensor[1]= Jtouch2;
touchSensor[2]= AAtouch1;
touchSensor[3]= AAtouch2;
touchSensor[4]= ARtouch1;
touchSensor[5]= ARtouch2;
touchSensor[6]= Ttouch1;
touchSensor[7]= Ttouch2;
String theStg = "<" + nf(touchSensor[0], 1) +
" " + nf(touchSensor[1], 1) +
" " + nf(touchSensor[2], 1) +
" " + nf(touchSensor[3], 1) +
" " + nf(touchSensor[4], 1) +
" " + nf(touchSensor[5], 1) +
" " + nf(touchSensor[6], 1) +
" " + nf(touchSensor[7], 1) +
">";
myPort.write(theStg);
}