Here is a little project wich can drive ws2812 ledstrip with an arduino plugged into a pinscape controller used as a ledwiz (so it should work with a reel ledwiz)
This is not a ledwiz clone but a collection of effects : contactors, fan, beacon, gear, lauch button, strobe..
This is a work in progress so...
The arduino is plugged on a ledwiz clone : the pinscape controller (kl25z)
The pinscape controller drives 3 rgb leds and 2 strobes.
I tried with a Uno and a Mega and both are working well.
Video
and code
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel Stick = Adafruit_NeoPixel(288, 22, NEO_GRB + NEO_KHZ800);
int d = Stick.numPixels();
int slingshot = 25;
int part = d/16;
int speed = 30;
int length = 90;
int limite1 = 25;
int limite2 = d-25;
int launch = 25;
void setup() {
// Serial.begin(9600);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(13, INPUT_PULLUP);
// Initialize all the pixelStrips
Stick.begin();
// Kick off a pattern
Stick.Color(0,0,0);
Stick.show();
}
void loop() {
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
Stick.show();
// Switch patterns on a button press:
if (digitalRead(2) == HIGH) // Slingshot Left Button #14 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all red
for (int i=limite1; i<limite1+slingshot; i++)
{
Stick.setPixelColor(i,Stick.Color(255,0,0));
}
Stick.show();
}
else if (digitalRead(3) == HIGH) // Slingshot Right Button #15 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all blue
for (int i=limite2; i>limite2 - slingshot; i--)
{
Stick.setPixelColor(i,Stick.Color(0,0,255));
}
Stick.show();
}
else if (digitalRead(4) == HIGH) // Launch Button #16 pressed
{
// Set stick to Launch Blue
for (int i=limite2 - launch; i<limite2; i++)
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
Stick.setPixelColor(i, (0, 0, 255)); // Set just this one
Stick.show();
delay(5);
}
}
else if (digitalRead(5) == HIGH) // Gear Button #17 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all pink
int foo = random(d);
Stick.setPixelColor(foo, 255,255,255); // Set pixel white
Stick.show(); // Update strip to show new pixel
delay(10); // Hold it for a moment
Stick.setPixelColor(foo, 0, 0, 0); // Pixel off
//Stick.Color1 = Stick.Wheel(random(255));
// Change will be reflected on next strip.show()
}
else if (digitalRead(6) == HIGH) // Beacon Button #18 pressed
{
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite1; i<length; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,255)); // light 'em up
}
Stick.show(); // show 'em
delay(speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite2; i>limite2 - length; i--) {
Stick.setPixelColor(i, Stick.Color(255,0,0)); // light 'em up
}
Stick.show(); // show 'em
delay(speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite1 + length; i<limite2 - length ; i++) {
Stick.setPixelColor(i, Stick.Color(255,255,255)); // light 'em up
}
Stick.show(); // show 'em
delay(speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite1; i<limite1 + length; i++) {
Stick.setPixelColor(i, Stick.Color(255,0,0)); // light 'em up
}
Stick.show(); // show 'em
delay(speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite2; i>limite2 - length ; i--) {
Stick.setPixelColor(i, Stick.Color(0,0,255)); // light 'em up
}
Stick.show(); // show 'em
delay(speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite1 + length; i<limite2 - length; i++) {
Stick.setPixelColor(i, Stick.Color(255,255,255)); // light 'em up
}
Stick.show(); // show 'em
delay(speed/2);
}
else if (digitalRead(7) == HIGH) // Strobe right Button #20 pressed
{
// Set stick to all white
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
Stick.show(); // show 'em
delay(speed);
for(int i=limite1; i<limite2; i++) {
Stick.setPixelColor(i, Stick.Color(255,255,255)); // light 'em up
}
Stick.show(); // show 'em
delay(speed);
}
else if (digitalRead(8) == HIGH) // Bumper Back Right Button #21 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all green
for (int i=d-(4*part); i>(9*part); i--)
{
Stick.setPixelColor(i,Stick.Color(0,255,0));
}
Stick.show();
}
else if (digitalRead(9) == HIGH) // Bumper Back Center Button #22 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all blue
for (int i=d-(7*part); i>(7*part); i--)
{
Stick.setPixelColor(i,Stick.Color(0,0,255));
}
Stick.show();
}
else if (digitalRead(10) == HIGH) // Bumper Back Left Button #23 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all red
for (int i=(4*part); i<(7*part); i++)
{
Stick.setPixelColor(i,Stick.Color(255,0,0));
}
Stick.show();
}
else if (digitalRead(11) == HIGH) // Bumper Middle Right Button #24 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all ???
for (int i=d-(1*part); i>d-(4*part); i--)
{
Stick.setPixelColor(i,Stick.Color(0,255,255));
}
Stick.show();
}
else if (digitalRead(12) == HIGH) // Bumper Middle Center Button #25 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all ???
for (int i=d-(2*part); i>d-(5*part); i--)
{
Stick.setPixelColor(i,Stick.Color(255,0,125));
}
for (int i=(2*part); i<(5*part); i++)
{
Stick.setPixelColor(i,Stick.Color(255,0,125));
}
Stick.show();
}
else if (digitalRead(13) == HIGH) // Bumper Middle Left Button #26 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all ???
for (int i=part; i<(2*part); i++)
{
Stick.setPixelColor(i,Stick.Color(200,25,0));
}
Stick.show();
}
else if (digitalRead(30) == HIGH) // ZB launch button Button #27 pressed
{
// Set stick to Launch Blue
for (int i=limite2 - launch; i<limite2; i++)
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
Stick.setPixelColor(i, (255, 0, 0)); // Set just this one
Stick.show();
delay(5);
}
}
else if (digitalRead(31) == HIGH) // Authentic launch ball Button #28 pressed
{
// Set stick to Launch Blue
for (int i=limite2 - launch; i<limite2; i++)
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
Stick.setPixelColor(i, (100, 0, 155)); // Set just this one
Stick.show();
delay(5);
}
}
else if (digitalRead(32) == HIGH) // Fan #29 pressed
{
// Set stick to Launch Blue
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
for (int i=limite1; i<d/2; i++)
{
Stick.setPixelColor(i, (0, 0, 255)); // Set just this one
Stick.setPixelColor(d-i, (0, 0, 255)); // Set just this one
Stick.show();
delay(5);
}
for (int i=d/2; i>limite1 ; i--)
{
Stick.setPixelColor(i, (0, 0, 0)); // Set just this one
Stick.setPixelColor(d-i, (0, 0, 0)); // Set just this one
Stick.show();
delay(5);
}
}
else if (digitalRead(33) == HIGH) // Shacker Button #30 pressed
{
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite1; i<limite1 + 2*part; i++) {
Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up
}
Stick.show(); // show 'em
delay(2*speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite2; i>limite2 - 2*part; i--) {
Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up
}
Stick.show(); // show 'em
delay(2*speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite1 + 2*part; i<limite1 + 4*part; i++) {
Stick.setPixelColor(i, Stick.Color(200,0,100)); // light 'em up
}
Stick.show(); // show 'em
delay(2*speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite2 - 2*part; i>limite2 - 4*part; i--) {
Stick.setPixelColor(i, Stick.Color(200,0,100)); // light 'em up
}
Stick.show(); // show 'em
delay(2*speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite1 + 4*part; i<limite1 + 6*part; i++) {
Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up
}
Stick.show(); // show 'em
delay(2*speed);
for(int i=0; i<d; i++) {
Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark
}
for(int i=limite2 - 4*part; i>limite2 - 6*part; i--) {
Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up
}
Stick.show(); // show 'em
delay(2*speed);
}
else if (digitalRead(34) == HIGH) // Bumper Middle Left Button #31 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all ???
for (int i=part; i<(4*part); i++)
{
Stick.setPixelColor(i,Stick.Color(0,255,255));
}
Stick.show();
}
else if (digitalRead(35) == HIGH) // Bumper Middle Left Button #32 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all ???
for (int i=part; i<(2*part); i++)
{
Stick.setPixelColor(i,Stick.Color(0,255,255));
}
Stick.show();
}
else if (digitalRead(36) == HIGH) // Bumper Middle Left Button #13 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all ???
for (int i=part; i<(2*part); i++)
{
Stick.setPixelColor(i,Stick.Color(0,55,200));
}
Stick.show();
}
else if (digitalRead(37) == HIGH) // Bumper Middle Left Button #12 pressed
{
for (int i=0; i<d; i++)
{
Stick.setPixelColor(i, 0);
} // Turn off all LEDs
// Set stick to all ???
for (int i=part; i<(2*part); i++)
{
Stick.setPixelColor(i,Stick.Color(255,55,0));
}
Stick.show();
}
}
Question
gech
Here is a little project wich can drive ws2812 ledstrip with an arduino plugged into a pinscape controller used as a ledwiz (so it should work with a reel ledwiz)
This is not a ledwiz clone but a collection of effects : contactors, fan, beacon, gear, lauch button, strobe..
This is a work in progress so...
The arduino is plugged on a ledwiz clone : the pinscape controller (kl25z)
The pinscape controller drives 3 rgb leds and 2 strobes.
I tried with a Uno and a Mega and both are working well.
Video
and code
#include <Adafruit_NeoPixel.h> Adafruit_NeoPixel Stick = Adafruit_NeoPixel(288, 22, NEO_GRB + NEO_KHZ800); int d = Stick.numPixels(); int slingshot = 25; int part = d/16; int speed = 30; int length = 90; int limite1 = 25; int limite2 = d-25; int launch = 25; void setup() { // Serial.begin(9600); pinMode(2, INPUT_PULLUP); pinMode(3, INPUT_PULLUP); pinMode(4, INPUT_PULLUP); pinMode(5, INPUT_PULLUP); pinMode(6, INPUT_PULLUP); pinMode(7, INPUT_PULLUP); pinMode(8, INPUT_PULLUP); pinMode(9, INPUT_PULLUP); pinMode(10, INPUT_PULLUP); pinMode(11, INPUT_PULLUP); pinMode(12, INPUT_PULLUP); pinMode(13, INPUT_PULLUP); // Initialize all the pixelStrips Stick.begin(); // Kick off a pattern Stick.Color(0,0,0); Stick.show(); } void loop() { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs Stick.show(); // Switch patterns on a button press: if (digitalRead(2) == HIGH) // Slingshot Left Button #14 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all red for (int i=limite1; i<limite1+slingshot; i++) { Stick.setPixelColor(i,Stick.Color(255,0,0)); } Stick.show(); } else if (digitalRead(3) == HIGH) // Slingshot Right Button #15 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all blue for (int i=limite2; i>limite2 - slingshot; i--) { Stick.setPixelColor(i,Stick.Color(0,0,255)); } Stick.show(); } else if (digitalRead(4) == HIGH) // Launch Button #16 pressed { // Set stick to Launch Blue for (int i=limite2 - launch; i<limite2; i++) { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs Stick.setPixelColor(i, (0, 0, 255)); // Set just this one Stick.show(); delay(5); } } else if (digitalRead(5) == HIGH) // Gear Button #17 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all pink int foo = random(d); Stick.setPixelColor(foo, 255,255,255); // Set pixel white Stick.show(); // Update strip to show new pixel delay(10); // Hold it for a moment Stick.setPixelColor(foo, 0, 0, 0); // Pixel off //Stick.Color1 = Stick.Wheel(random(255)); // Change will be reflected on next strip.show() } else if (digitalRead(6) == HIGH) // Beacon Button #18 pressed { for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite1; i<length; i++) { Stick.setPixelColor(i, Stick.Color(0,0,255)); // light 'em up } Stick.show(); // show 'em delay(speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite2; i>limite2 - length; i--) { Stick.setPixelColor(i, Stick.Color(255,0,0)); // light 'em up } Stick.show(); // show 'em delay(speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite1 + length; i<limite2 - length ; i++) { Stick.setPixelColor(i, Stick.Color(255,255,255)); // light 'em up } Stick.show(); // show 'em delay(speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite1; i<limite1 + length; i++) { Stick.setPixelColor(i, Stick.Color(255,0,0)); // light 'em up } Stick.show(); // show 'em delay(speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite2; i>limite2 - length ; i--) { Stick.setPixelColor(i, Stick.Color(0,0,255)); // light 'em up } Stick.show(); // show 'em delay(speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite1 + length; i<limite2 - length; i++) { Stick.setPixelColor(i, Stick.Color(255,255,255)); // light 'em up } Stick.show(); // show 'em delay(speed/2); } else if (digitalRead(7) == HIGH) // Strobe right Button #20 pressed { // Set stick to all white for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } Stick.show(); // show 'em delay(speed); for(int i=limite1; i<limite2; i++) { Stick.setPixelColor(i, Stick.Color(255,255,255)); // light 'em up } Stick.show(); // show 'em delay(speed); } else if (digitalRead(8) == HIGH) // Bumper Back Right Button #21 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all green for (int i=d-(4*part); i>(9*part); i--) { Stick.setPixelColor(i,Stick.Color(0,255,0)); } Stick.show(); } else if (digitalRead(9) == HIGH) // Bumper Back Center Button #22 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all blue for (int i=d-(7*part); i>(7*part); i--) { Stick.setPixelColor(i,Stick.Color(0,0,255)); } Stick.show(); } else if (digitalRead(10) == HIGH) // Bumper Back Left Button #23 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all red for (int i=(4*part); i<(7*part); i++) { Stick.setPixelColor(i,Stick.Color(255,0,0)); } Stick.show(); } else if (digitalRead(11) == HIGH) // Bumper Middle Right Button #24 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all ??? for (int i=d-(1*part); i>d-(4*part); i--) { Stick.setPixelColor(i,Stick.Color(0,255,255)); } Stick.show(); } else if (digitalRead(12) == HIGH) // Bumper Middle Center Button #25 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all ??? for (int i=d-(2*part); i>d-(5*part); i--) { Stick.setPixelColor(i,Stick.Color(255,0,125)); } for (int i=(2*part); i<(5*part); i++) { Stick.setPixelColor(i,Stick.Color(255,0,125)); } Stick.show(); } else if (digitalRead(13) == HIGH) // Bumper Middle Left Button #26 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all ??? for (int i=part; i<(2*part); i++) { Stick.setPixelColor(i,Stick.Color(200,25,0)); } Stick.show(); } else if (digitalRead(30) == HIGH) // ZB launch button Button #27 pressed { // Set stick to Launch Blue for (int i=limite2 - launch; i<limite2; i++) { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs Stick.setPixelColor(i, (255, 0, 0)); // Set just this one Stick.show(); delay(5); } } else if (digitalRead(31) == HIGH) // Authentic launch ball Button #28 pressed { // Set stick to Launch Blue for (int i=limite2 - launch; i<limite2; i++) { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs Stick.setPixelColor(i, (100, 0, 155)); // Set just this one Stick.show(); delay(5); } } else if (digitalRead(32) == HIGH) // Fan #29 pressed { // Set stick to Launch Blue for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs for (int i=limite1; i<d/2; i++) { Stick.setPixelColor(i, (0, 0, 255)); // Set just this one Stick.setPixelColor(d-i, (0, 0, 255)); // Set just this one Stick.show(); delay(5); } for (int i=d/2; i>limite1 ; i--) { Stick.setPixelColor(i, (0, 0, 0)); // Set just this one Stick.setPixelColor(d-i, (0, 0, 0)); // Set just this one Stick.show(); delay(5); } } else if (digitalRead(33) == HIGH) // Shacker Button #30 pressed { for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite1; i<limite1 + 2*part; i++) { Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up } Stick.show(); // show 'em delay(2*speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite2; i>limite2 - 2*part; i--) { Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up } Stick.show(); // show 'em delay(2*speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite1 + 2*part; i<limite1 + 4*part; i++) { Stick.setPixelColor(i, Stick.Color(200,0,100)); // light 'em up } Stick.show(); // show 'em delay(2*speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite2 - 2*part; i>limite2 - 4*part; i--) { Stick.setPixelColor(i, Stick.Color(200,0,100)); // light 'em up } Stick.show(); // show 'em delay(2*speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite1 + 4*part; i<limite1 + 6*part; i++) { Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up } Stick.show(); // show 'em delay(2*speed); for(int i=0; i<d; i++) { Stick.setPixelColor(i, Stick.Color(0,0,0)); // set 'em dark } for(int i=limite2 - 4*part; i>limite2 - 6*part; i--) { Stick.setPixelColor(i, Stick.Color(100,0,200)); // light 'em up } Stick.show(); // show 'em delay(2*speed); } else if (digitalRead(34) == HIGH) // Bumper Middle Left Button #31 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all ??? for (int i=part; i<(4*part); i++) { Stick.setPixelColor(i,Stick.Color(0,255,255)); } Stick.show(); } else if (digitalRead(35) == HIGH) // Bumper Middle Left Button #32 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all ??? for (int i=part; i<(2*part); i++) { Stick.setPixelColor(i,Stick.Color(0,255,255)); } Stick.show(); } else if (digitalRead(36) == HIGH) // Bumper Middle Left Button #13 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all ??? for (int i=part; i<(2*part); i++) { Stick.setPixelColor(i,Stick.Color(0,55,200)); } Stick.show(); } else if (digitalRead(37) == HIGH) // Bumper Middle Left Button #12 pressed { for (int i=0; i<d; i++) { Stick.setPixelColor(i, 0); } // Turn off all LEDs // Set stick to all ??? for (int i=part; i<(2*part); i++) { Stick.setPixelColor(i,Stick.Color(255,55,0)); } Stick.show(); } }5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.