G4P Label overwrite

edited April 2014 in Library Questions

Hello I'm trying to get data from Arduino to G4P GUI. I have created interface with G4P GUI Builder and connected Arduino board to this program. However when I start the program and get data from Arduino to Label I see white borders around the value and also it doesn't erase previous text so after few iterations label looks like a mess. Loop code:

void draw(){
label1.setText("");
label1.setText(str(arduino_value));
}

How can I fix it? Thanks in advance

Tagged:

Answers

  • edited April 2014 Answer ✓

    You must clear the background at the start of the draw method e.g.

    void draw(){
      background(200);
      label1.setText("");
      label1.setText(str(arduino_value));
    }
    
Sign In or Register to comment.