We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to load variables from a table into text on Processing but at the moment the code just seems to write the variables on top of themselves. I would like these variables to change per second (hence the delay at the end of void draw()). The results (text) also seem to take a very long time to show up on the screen. I have tried various ways but I do not know what it is that I'm doing wrong. This is the code:
Table table; TableRow row; int fData;
void setup() { size(800, 500); background(255); table = loadTable("test2.csv", "header");
println(table.getColumnCount() + " columns in table"); println(table.getRowCount() + " rows in table"); println("Date: " + table.getString(1, 0)); println("Start time: " + table.getString(0, 1)); println("Duration: " + (table.getRowCount()/60) + " minutes");
}
void draw () { background(255,255,255); text("Date: "+table.getString(0,0), 30,400); fill(0,0,0);
for (int i = 0; i < 23; i = i+1) {
fData=((table.getInt(i,2))/1000); text("Time: "+table.getString(i,1), 30, 420); text("Frequency: "+table.getInt(i,2), 30, 440); text(("Frequency to alpha: "+fData), 30, 460);
delay(1000);
}
}
Answers
Sounds like the program gets stuck in some infinite loop.
Can you make your code readable? Hit ctrl+t in Processing before exporting, then hightlight your code here and click the C button (ctrl+o).
https://forum.processing.org/two/discussion/32/how-to-format-text-and-code-on-the-new-forum/p1