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
- String val="pwwe";
- int j=0;
- void setup()
- {
- size(500, 500);
- frameRate(1);
- textSize(32);
- }
- void draw()
- {
- background(111);
- //myPort.write("temp?");
- int i=0;
- String temp="";
- while ( i < 10) {
- temp = temp+char(i+j+65) ;
- i++;
- }
- j++;
- val = temp+"\n"+val;
- println(val);
- if (val != null && val.length() > 0) {
- text(val, 50, 100);
- }
- }