import processing.serial.*;
Serial myPort;
String val;
GennerateGraph gn = new GennerateGraph();
PFont font;
void setup()
{
font = loadFont("Rockwell-CondensedBold-48.vlw");
size(720, 1280);
String portName = Serial.list()[0];
myPort = new Serial(this, portName, 9600);
myPort.clear();
}
void draw()
{
background(0);
textFont(font);
gn.GenGraph();
if ( myPort.available() > 0)
{
val = myPort.readStringUntil(10);
float i;
if(val == null)
{
i=0;
}
else
{
i= float(val);
}
int resul=(int)i;
println(resul);
text(resul, width/2, height/2);
}
}