Text should stay
in
Programming Questions
•
1 year ago
Hello,
i have this code:
- import processing.serial.*;
- PFont font;
- int lf = 10; // Linefeed in ASCII
- String myString = null;
- Serial myPort; // Serial port you are using
- float num;
- void setup() {
- myPort = new Serial(this, Serial.list()[0], 9600);
- myPort.clear();
- font = createFont("Arial", 12, false);
- textFont(font, 14);
- }
- void draw() {
- background(0);
- fill(0,255,0);
- while (myPort.available() > 0) {
- myString = myPort.readStringUntil(lf);
- if (myString != null) {
- print(myString); // Prints String
- num=float(myString); // Converts and prints float
- println(num);
- text(myString,10,10);
- }
- }
- myPort.clear();
The value is coming from my arduino board, i'd like to display the value, but the value does blink up shortly and dissapears then. I'd like to show it permantent.
1