Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : updating text

$
0
0

I dont't have serial but this is the idea when you want the last entry on top of a list:

you store the serial data in temp (line 16) and after the while loop you place temp with a line break \n in front of val (line 20).

Greetings, Chrisir   


  1. String val="pwwe";
  2. int j=0;
  3. void setup()
  4. {
  5.   size(500, 500);
  6.   frameRate(1);
  7.   textSize(32);
  8. }
  9. void draw()
  10. {
  11.   background(111);
  12.   //myPort.write("temp?");
  13.   int  i=0;
  14.   String temp="";
  15.   while ( i < 10) {
  16.     temp = temp+char(i+j+65) ;
  17.     i++;
  18.   }
  19.   j++;
  20.   val = temp+"\n"+val;
  21.   println(val);
  22.   if (val != null && val.length() > 0) {
  23.     text(val, 50, 100);
  24.   }
  25. }


Viewing all articles
Browse latest Browse all 1768

Trending Articles