I have a question concerning drawing different thick lines in my sketch. If I want to draw two lines and each of them should use a different stroke weight - how would I do this in Processing?
My code:
import processing.serial.*;
Serial myPort;
int value;
int padding = 100;
float m;
void setup() {
size(1440, 900);
myPort = new Serial(this, Serial.list()[4], 9600);
smooth();
strokeWeight(3);
stroke(100);
}
void draw() {
background(#FFFFF0);
if (myPort.available() > 0) {
value = myPort.read();
println(value);
m = map(value, 255, 0, padding, width-padding);
}
line(padding, height/2, width-padding, height/2);
noStroke();
fill(#FFDE14);
stroke (0,255,0);
strokeWeight(5);
line (m, height/2, m, 100);
stroke(100);
}```
Many thanks for your help.