hi guys,
i have a batch of code found online, that the coder posted for others to use, its using adafruits libraries and im using it to control a string of 28 ws2812b led strip.
however, while i have a very basic understanding of the code, and it is VERY basic, i'd like to add a section where the middle 2 leds (14,15) turn on at the beginning of the code and stay on.
the existing code is essentially an led chaser effect running from either end of the stip to the center,
but those 2 center leds need to stay on at all times without turning off as a result of the existing code.
heres the original code:
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 2
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 28
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 175; // delay for half a second
void setup() {
pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
while(1){
for(int i = NUMPIXELS - 1; i >= (NUMPIXELS/2); i--) {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,0,255)); // Blue Bright
pixels.setPixelColor(i+2, pixels.Color(0,0,40)); // Blue Not So Bright
pixels.setPixelColor((NUMPIXELS-1)-i, pixels.Color(0,0,255)); // Blue Bright
pixels.setPixelColor((NUMPIXELS-3)-i, pixels.Color(0,0,40)); // Blue Not So Bright
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
pixels.setPixelColor(i, pixels.Color(0,0,0));
pixels.setPixelColor((NUMPIXELS-1)-i,pixels.Color(0,0,0)); // Setting the pixel to no output
pixels.setPixelColor((NUMPIXELS-3)-i,pixels.Color(0,0,0)); // Setting the pixel to no output
pixels.setPixelColor(i+2,pixels.Color(0,0,0));
pixels.show();
}
}
}
now am i right in thinking i can reduce the "numpixels" from 28 to 26 and add a bit into the "voidsetup" to write to leds 14 and 15 to turn on blue? or would that cause a conflict in the signal being sent down the signal line of the led strip?
also because of the code chasing from either end, would the code still operate from the 1st and 28th led or would it simply start from leds 1 and 26?