I would like to plot an array in a processing sketch but not one element at the time, everytime the entire array in a plot window of the same size of the entire array.
Now I´m using eclipse and processing together, so my code is the following:
public void setup(){
size(1000,300);
background(0);
this.serialString=new String("0,0,0");
//this.serialInt=0;
}
public void draw(){
if (this.serialString != null) {
//xpos=0;
//for (int i = 0; i < array_length-1; i++) {
// set the drawing color. Pick a pretty color:
stroke(123,128,158);
//stroke(115);
if (xpos >= width) {
xpos = 0;
// clear the screen by resetting the background:
background(0);
}
else {
// increment the horizontal position for the next reading:
This sketch is related to the last of these 3 graphs and as you can see it is working ok.
But as I said I would like to print the entire array time to time. Is it possible?
My group leader told me that, he said that we should have a window of the same size of the array even if I didn´t really understand what he meant. I will also try to ask him again because to me it seems ok to do it in this way.
The graph is updated in real time and I have also the storage of the array so I can implement averaging functions and stuff like that.
someone of you could link me to a page in which is explained clearly how to read multiple variables in processing from a Serial port to which is connected an Arduino.
I need both the Arduino sketch and the Processing sketch.
I searched on the internet but I found too different solutions, with json, with firmata, with readuntil() etc...
Could you please tell me what is the most reliable?