unsigned long prevValue , currValue, Addup = 16711680, this_led_color;
Magic numbers need explanations.
for(int x = 0 ; x < STRIP_LENGTH ; x++)
strip_colors[x] = 0;
Global variables are initialized for you.
if (endTime - startTime < 30 && checkBUTTON == false){
rightWIDTH = 29;
Serial.println("30 leds");
}
else if (endTime - startTime >= 30 && endTime - startTime <= 40 ) {
rightWIDTH = 34;
Serial.println("35 leds");
}
else if (endTime - startTime >= 40 && endTime - startTime <= 50 ) {
rightWIDTH = 39;
Serial.println("40 leds");
}
else if (endTime - startTime >= 50 && endTime - startTime <= 60 ) {
rightWIDTH = 44;
Serial.println("50 leds");
}
else if (endTime - startTime >= 60 && endTime - startTime <= 70 ) {
rightWIDTH = 49;
Serial.println("60 leds");
}
else if (endTime - startTime >= 70 && endTime - startTime <= 80 ) {
rightWIDTH = 54;
Serial.println("70 leds");
}
else if (endTime - startTime >= 80 && endTime - startTime <= 90 ) {
rightWIDTH = 59;
Serial.println("80 leds");
}
else if (endTime - startTime >= 90 && endTime - startTime <= 100 ) {
rightWIDTH = 64;
}
else if (endTime - startTime >= 100 && endTime - startTime <= 110 ) {
rightWIDTH = 69;
}
else if (endTime - startTime >= 110 && endTime - startTime <= 120 ) {
rightWIDTH = 74;
Serial.println("75 leds");
}
else if (endTime - startTime >= 120 && endTime - startTime <= 130 ) {
rightWIDTH = 80;
Serial.println("75 leds");
}
else if (endTime - startTime >= 130 && endTime - startTime <= 140 ) {
rightWIDTH = 84;
Serial.println("75 leds");
}
else if (endTime - startTime >= 140 && endTime - startTime <= 150 ) {
rightWIDTH = 89;
Serial.println("75 leds");
}
else if (endTime - startTime >= 150 && endTime - startTime <= 160 ) {
rightWIDTH = 94;
Serial.println("75 leds");
}
else if (endTime - startTime >= 160 && endTime - startTime <= 170 ) {
rightWIDTH = 99;
Serial.println("75 leds");
}
else if (endTime - startTime >= 170 && endTime - startTime <= 180 ) {
rightWIDTH = 104;
Serial.println("75 leds");
}
else if (endTime - startTime >= 180 && endTime - startTime <= 190 ) {
rightWIDTH = 109;
Serial.println("75 leds");
}
else if(endTime - startTime > 190){
There would be a hell of a lot less typing, and calculating, if you calculated endTime - startTime ONCE.
post_frame_moreLEDS_testing(0x000000, a, a+size2);
How does that differ from 0 or 0x0 or 0b0?
void post_frame_moreLEDS_testing (long LEDcolor, int startLED, int endLED) {
Out the curly brace on the line with the statement, to save a line. Then, add a blank line. Makes sense to me. NOT!
this_led_color = 0x000000; //24 bits of color data
No, it isn’t… 0x000000 is still 0. That’s a 16 bit 0.
Addup = Addup - 655360;
for(byte color_bit = 23 ; color_bit != 255 ; color_bit--) {
Addup = Addup + 655360;
for(byte color_bit = 23 ; color_bit != 255 ; color_bit--) {
More magic number with no explanation.
Having read through your code, I still can’t understand what your problem is.
but it isn’t working right now
That’s pretty lame, you know. The code does something. Only you can see what it does.