serialVisualization/visualizationtest/visualizationtest.pde

40 lines
822 B
Plaintext
Raw Normal View History

float rawvalue=0;
2019-06-09 14:43:53 +00:00
float xoff = 0.0;
float xoff2 = 0;
2019-06-09 14:43:53 +00:00
Visualization vis;
void setup() {
size(640, 360);
//vis = new BarV(150,150,10,100,0,100);
//vis = new BarH(150,150,100,10,0,100);
//vis = new Tacho(150,150,100,0,100);
//vis = new Direction(150,150,100,-127/30*360,127/30*360,0,2000,PI/2+PI);
vis = new Direction(150,150,100,-127/30*360,127/30*360,0,2000,PI/2+PI, -127,127); //uses arc
//vis = new GraphRoll(150,150,200,100,0,100, 1);
2019-06-09 14:43:53 +00:00
2019-06-10 09:53:01 +00:00
vis.setShowMinMax(false);
2019-06-09 14:43:53 +00:00
vis.setTitle("Testwert");
}
void draw() {
background(255);
rawvalue +=random(-10,10);
rawvalue = constrain(rawvalue, -127,100);
//xoff += 0.01;
2019-06-09 14:43:53 +00:00
xoff2 += 0.004;
//rawvalue=noise(xoff) * 100;
2019-06-09 14:43:53 +00:00
vis.setValue(rawvalue);
//for direction with length
vis.setValue2(noise(xoff2)*2000);
2019-06-09 14:43:53 +00:00
vis.drawVis();
}