So Will try this again (and try to follow the rules)
I have the the following code. The issue is that the only section in the void InitializeAllLeds routine that works is the BlinkRed call at the end. The called routines are posted below. As can be seen BlinkBlue is identical to BlinkRed except for the color to be shown.
Serial Monitor shows int i decrementing as expected but no leds are illuminated. It also shows the counter in the // NOW FLASH SHIFTPOINT LED’s section incrementing as expected but again no LEDs lit.
Anyone see anything that I am overlooking??
// ******************************************************************************
// **************** At Startup Cycle All LEDS through all modes **************
// ******************************************************************************
void InitializeAllLeds(long delayTime) {
// Turn on All Leds one at a time
int i = 47;
while ( i > 0){
i = i-1;
Serial.print ("i = ");
Serial.println (i);
ring[i] = CRGB:: Green;
FastLED.setBrightness(35);
FastLED.show(100);
delay (10);
}
// Now that LED_NUMBER is at Min turn off LEDS
FastLED.clear(); // clear all pixel data
FastLED.show();
FastLED.setBrightness(50);
// NOW FLASH SHIFTPOINT LED's
int counter = 0;
while (counter <5){
ShiftPointWarning ();
counter ++;
Serial.print ("Counter = ");
Serial.println (counter);
}
counter = 0;
FastLED.setBrightness(75);
// NOW FLASH OVERREV LED's
while (counter <5){
OverRevWarning ();
delay (65);
counter ++;
}
counter = 0;
}
// ******************************************************************************
// ********************************** BLINK LEDS BLUE****************************
// ******************************************************************************
void BlinkBlue(long delayTime) {
FastLED.clear(); // clear all pixel data
FastLED.show();
NumLedsToLight = NUM_LEDS; //Force all LED's Red
LED_NUMBER = 0;
FastLED.setBrightness(75);
while (LED_NUMBER < NumLedsToLight) {
ring[LED_NUMBER] = CRGB::Blue;
LED_NUMBER < NumLedsToLight; ++LED_NUMBER;
}
FastLED.show(150);
delay (20);
BuildAndAverageFiveRPMCounts ();
}
// ******************************************************************************
// ********************************** BLINK LEDS RED*****************************
// ******************************************************************************
void BlinkRed(long delayTime) {
FastLED.clear(); // clear all pixel data
FastLED.show();
NumLedsToLight = NUM_LEDS; //Force all LED's Red
LED_NUMBER = 0;
FastLED.setBrightness(75);
while (LED_NUMBER < NumLedsToLight) {
ring[LED_NUMBER] = CRGB::Red;
LED_NUMBER < NumLedsToLight; ++LED_NUMBER;
}
FastLED.show(150);
delay (20);
BuildAndAverageFiveRPMCounts ();
}
// ******************************** Turn OFF All LEDs ****************************
// * callable routine BlinkOFF all LEDs *
// *******************************************************************************
void BlinkOFF(long delayTime) {
FastLED.clear(); // clear all pixel data
FastLED.show(); //Turn off all LED's
}
// ****************************************************************************
// * SHIFTPOINT WARNING - BLINK BLUE *
// ****************************************************************************
void ShiftPointWarning () {
#define BRIGHTNESS 50
delay(100); //timing for a leisurly blink rate
BlinkBlue (delay);
BlinkOFF (delay);
}
// ****************************************************************************
// * OVERREV Warning - BLINK ALL LED's RED *
// ****************************************************************************
void OverRevWarning () {
#define BRIGHTNESS 75
delay(65); //timing for a FRENETIC blink rate
BlinkRed (delay);
BlinkOFF (delay);
}