Ive been working on a project with my arduino uno and rgb led strips. Is it possible to set a button to play a sketch when pressed, assign a sketch per button? If so what would i need to get this done? Ive been working on a few sequences.
Sure.
In your loop() function..
First check if a button has been clicked. If so, set a variable as to what patten you want. Then do a switch statement choosing the pattern your currently doing.
-jim lee
Your terminology is a bit off. a sketch is the complete code you download to the arduino. When you press a button, you would call a function which is part of the sketch, something like this
void setup()
{
// stuff here
}
void loop() {
if ( digitalRead(buttonAPin) == HIGH ) {
doSequenceA();
}
if (digitalRead(buttonBPin) == HIGH ) {
doSequenceB();
}
// ...
}
void doSequenceA() {
// display what you want
}
void doSequenceB() {
// display what you want
}