import processing.serial.*;
float val;
Serial myPort;  // Create object from Serial class
float time_sec;

void setup() 
{
 
  String portName = "COM6";
  myPort = new Serial(this, portName, 9600);
  myPort.bufferUntil('\n'); 
  size(640,480);
  smooth();
  frameRate(30);
  PFont f = createFont("Arial", 200);
  textFont(f);
  size(500, 500);
}


void draw() {
  if (myPort.available() >0) 
  {
    val = myPort.read();
    time_sec = val/100;
    println(time_sec);
    fill(#000000);
    text(time_sec, 40, 200);
  }
  
}
