control p5 button - problem with value
in
Contributed Library Questions
•
3 years ago
-
void setup()
{
size(100,199);
background(0);
controlP5 = new ControlP5(this);
controlP5.addButton("achsen",0,10,10,80,19);
}void achsen(int theValue) {
if (theValue == 1){
println("click1");
}
else if (theValue == 0) {
println("click2");
}
}
I have no idea, why this simple sketch doesn't work... Why can't I use buttons like toggles or where is my problem? I would like to use them as booleans.. if the Value==1 then boolean = true and else and work with them... But it doesn't work...
where's my mistake?
1