Change stroke colour using a component button
in
Programming Questions
•
1 year ago
i have a component button attached to pin 7 and i have my POTs creating lines with a stroke colour of 255,0,0 in HSB colourMode. The problem i am having is within my sketch i have two stroke() references within my sketch if i change both of them to 255,255,255 this changes my line to red.
what im wanting to do is but setting up my button i want to be able to press my button to change my colour from black (255,0,0) to red (255,255,255)
i have tried something like this:
if(arduino.digitalRead(buttonPin3)==Arduino.LOW)
stroke(255,0,0);
} else {
stroke(255,255,255);
}
but nothing works i think it has something to do with me having to have two stroke() references in my sketch. can anyone help out please.
Thanks guys.
1