the code parts for strip1 are missing in setup (begin, show, setBrightness, clear)
google brought me to
https://quinled.info/2021/03/10/maximum-length-data-wire-leds-ws2812b-sk6812-ws2815/
I think you have to test.
If the result is unstable, cut the line and add a pixel in the middle of the extension line to "boost" the signal.
edit:
instead of duplicating code, you could use arrays and call code in for loops
something like:
/* Noiasca Neopixel Display
based on 40 scoreboard
http://werner.rothschopf.net/202005_arduino_neopixel_display.htm
by noiasca
2022-01-21
*/
const byte ledPin = 12; // Which pin on the Arduino is connected to the NeoPixels?
const byte ledPin1 = 11; // Which pin on the Arduino is connected to the NeoPixels second strip?
const byte numDigits = 2; // How many digits (numbers) are available on each display
const byte pixelPerDigit = 7; // all pixels, including decimal point pixels if available at each digit
const byte addPixels = 0; // unregular additional pixels to be added to the strip
const byte startPixelA = 0; // start pixel of display A
const byte startPixelB = 14; // start pixel of display B
const byte startPixelC = 0; // start pixel of display C
const byte startPixelD = 14; // start pixel of display D
const byte buttonApin = A3; // button pin player A, connects to GND
const byte buttonApin1 = A4; // button pin player A subtract, connects to GND
const byte buttonBpin = A0; // button pin player B, connects to GND
const byte buttonBpin1 = A2; // button pin player B subtract, connects to GND
const byte buttonResetPin = A1; // button to reset scores, connects to GND
byte counterA; // counts/goals/score for player A
byte counterB; // counts/goals/score for player B
const uint16_t ledCount(pixelPerDigit * numDigits * 2 + addPixels);
/*
Segments are named and orded like this
SEG_A
SEG_F SEG_B
SEG_G
SEG_E SEG_C
SEG_D SEG_DP
in the following constant array you have to define
which pixels belong to which segment
*/
typedef uint8_t segsize_t;
const segsize_t segment[8] {
0b00000001, // SEG_A
0b00000010, // SEG_B
0b00000100, // SEG_C
0b00001000, // SEG_D
0b00010000, // SEG_E
0b00100000, // SEG_F
0b01000000, // SEG_G
0b00000000 // SEG_DP
};
#include <Adafruit_NeoPixel.h> // install Adafruit library from library manager
Adafruit_NeoPixel strip[] {
{ledCount, ledPin, NEO_GRB + NEO_KHZ800},
{ledCount, ledPin1, NEO_GRB + NEO_KHZ800}
};
#include <Noiasca_NeopixelDisplay.h> // download library from: http://werner.rothschopf.net/202005_arduino_neopixel_display.htm
// in this sketch we handle displayA and displayB as two individual displays
// you can also use a array of displays
Noiasca_NeopixelDisplay displayA[] {
{strip[0], segment, numDigits, pixelPerDigit, startPixelA},
{strip[1], segment, numDigits, pixelPerDigit, startPixelC}
};
Noiasca_NeopixelDisplay displayB[] {
{strip[0], segment, numDigits, pixelPerDigit, startPixelB},
{strip[1], segment, numDigits, pixelPerDigit, startPixelD}
};
#include <OneButton.h> // install OneButton library from library manager
OneButton buttonA(buttonApin, true);
OneButton buttonA1(buttonApin1, true);
OneButton buttonB(buttonBpin, true);
OneButton buttonB1(buttonBpin1, true);
OneButton buttonReset(buttonResetPin, true);
void clickA()
{
counterA++;
Serial.print(F("PlayerA increase ")); Serial.println(counterA);
for (auto &i : displayA)
{
i.setCursor(0);
if (counterA < 10) i.print(" ");
i.print(counterA);
}
}
void clickA1() //for decrease
{
if (counterA > 0) counterA--;
Serial.print(F("PlayerA decrease ")); Serial.println(counterA);
for (auto &i : displayA)
{
i.setCursor(0);
if (counterA < 10) i.print(" ");
i.print(counterA);
}
}
void clickB()
{
counterB++;
Serial.print(F("PlayerB increase ")); Serial.println(counterB);
for (auto &i : displayB)
{
i.setCursor(0);
if (counterB < 10) i.print(" ");
i.print(counterB);
}
}
void clickB1() //for decrease
{
if (counterB > 0) counterB--;
Serial.print(F("PlayerB decrease ")); Serial.println(counterB);
for (auto &i : displayB)
{
i.setCursor(0);
if (counterB < 10) i.print(" ");
i.print(counterB);
}
}
void resetScore()
{
Serial.println(F("Reset Score"));
counterA = 0;
counterB = 0;
for (auto &i : displayA)
{
i.clear();
i.print(" ");
i.print(counterA);
}
for (auto &i : displayB)
{
i.clear();
i.print(" ");
i.print(counterB);
}
}
void setup()
{
Serial.begin(9600);
Serial.println(F("\nNoiascaNeopixelDisplay\n40 scoreboard two displays"));
for (auto & i : strip)
{
i.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
i.show(); // Turn OFF all pixels ASAP
i.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
i.clear();
}
displayA[0].setColorFont(0xAA0000); // each display gets its own color, e.g. corresponding to the button color
displayA[1].setColorFont(0xAA0040);
displayB[0].setColorFont(0xAA0080);
displayB[1].setColorFont(0xAA00F0);
Serial.println(F("test display"));
for (byte j = 99; j > 0; j = j - 11)
{
for (auto &i : displayA) i.print(j);
for (auto &i : displayB) i.print(j);
delay(200);
}
for (auto & i : displayA) i.print(" 0");
for (auto & i : displayB) i.print(" 0");
buttonA.attachClick(clickA);
buttonA1.attachClick(clickA1);
buttonB.attachClick(clickB);
buttonB1.attachClick(clickB1);
buttonReset.attachLongPressStart(resetScore);
}
void loop()
{
buttonA.tick();
buttonA1.tick();
buttonB.tick();
buttonB1.tick();
buttonReset.tick();
}
Has still duplicated lines of code, but you get the idea ...