How to print serial values above rect and not blur

hello @glv , i 've learned what u sent for me. i’ve just tried on my own program, and it’s working bro.
image

// test print data on top of rect and ellips

import processing.serial.*;


float temp;
float hum;
float load;


Serial port;

void setup() {

  size(400, 400);
  port = new Serial(this, "COM5", 9600);

}

void draw() {
  background(0);

  if (port.available() > 0) {
    String val = port.readString();
    String [] list = split(val, ',');
    temp = float(list[0]);
    hum = float(list[1]);
    load = float(list[2]);

   }
  stroke(255);
  fill(255);
  rect(80, 80, 60, 60, 12);
  rect(220, 80, 60, 60, 12);
  ellipse(180, 200, 100, 100);

  //fill(0, 120, 255);
  PFont f = createFont("Georgia", 70);
  textFont(f);
  textSize(15);
  text("Ambient Temp(°C)", 60, 70);
  text("Humidity(%)", 210, 70);
  text("Load (Kg)", 150, 270);

  //fill(255, 1, 2);
  textSize(15);
  fill(0, 0, 255);
  text(temp, 90, 115);
  fill(255, 0, 0);
  text(hum, 225, 115);
  fill(0, 255, 0);
  text(load, 150, 205);

}

1 Like