hi, communication over serial link might
be more efficient if you send ONE line ( every ? second? )
( i call this CSV line ( like used by spreadsheets… ) )
0,1,0,0,0,1
you not mention your connected hardware on the inverted inputs
but if you connect Arduino IDE and start the Monitor
what print you get, can you post it here?
When connecting a sensor to a pin configured with INPUT_PULLUP, the other end should be connected to ground. In the case of a simple switch, this causes the pin to read HIGH when the switch is open, and LOW when the switch is pressed.
processing
-a- use better
https://processing.org/reference/libraries/serial/serialEvent_.html
example…
String data, val="NaN";
int var;
void serialEvent(Serial p) { // handle serial data
data = trim(p.readStringUntil('\n'));
if (data != null) {
val = data;
var = int(val);
println("val "+val+" var "+var); // print every GOOD line and if it is understood
}
}
-b- add use a
-c- the
inBuffer.equals("Red")
actually looks good.
so -b- trim might solve the problem