i help you with the
framework
int Nin = 33;
float Nout;
float my_map(float n, float inlow, float inhigh, float outlow, float outhigh) {
float in_range = 0;
// you do the first math and show us
return(in_range);
}
void setup() {
size(100, 100);
Nout = my_map(Nin, 0, 100, 0, 200);
println("Nin: "+Nin+" my_map "+Nout);
}
void draw() {
}
inthere you start with some math
and as we are using processing we must have some minimal graphic show
int Nin = 33;
float Nout;
float my_map(float n, float inlow, float inhigh, float outlow, float outhigh) {
float in_range = n;
return(in_range);
}
void setup() {
size(120, 220);
Nout = my_map(Nin, 0, 100, 0, 200);
println("Nin: "+Nin+" my_map "+Nout);
}
void draw_graph() {
for ( int i=0;i<101;i++){
int posx = i+10;
int posy = 210 - int(my_map(i, 0, 100, 0, 200));
if( i == Nin ) { stroke(200,0,0); } else { stroke(0); }
line(posx,210,posx,posy);
}
}
void draw() {
draw_graph();
}
if you want play p5.js here