please help interpreting serial data.
in
Integration and Hardware
•
19 days ago
import processing.serial.*;
Serial com;
String input;
int r=0, g=0, b=0, x=0, y=0, z=0;
void setup()
{
com=new Serial(this, "COM11", 9600);
}
void draw()
{
//print(com.readString());
background(r, g, b);
}
void serialEvent(Serial com)
{
print(com.readString());
// input= com.readStringUntil(10);
input = com.readStringUntil(10);
String[] xyz = splitTokens(input, ",");
}
the following program is giving Null pointer exception while executing.
my serial input is
25,14,15
23,23,15
12,15,94
54,45,89
etc.
Serial com;
String input;
int r=0, g=0, b=0, x=0, y=0, z=0;
void setup()
{
com=new Serial(this, "COM11", 9600);
}
void draw()
{
//print(com.readString());
background(r, g, b);
}
void serialEvent(Serial com)
{
print(com.readString());
// input= com.readStringUntil(10);
input = com.readStringUntil(10);
String[] xyz = splitTokens(input, ",");
}
the following program is giving Null pointer exception while executing.
my serial input is
25,14,15
23,23,15
12,15,94
54,45,89
etc.
1