Using an IDE 1.0.5-r2, FastLED 2.1beta, an Arduino Micro, and UCS1903’s with a Memsic2125 Accelerometer. The following code will not allow me to fade all the way out to black, there is the tiniest of flicker going on. Using the UCS1903B setting has the same effect, but slightly worse. Any recommendations?
====================CODE
float brightness;
long fadeTimer;
#define fade .9
#define fadeWait 20
void peakTrigger(){
if((accelerationX > 3800.00) || (accelerationY < -3800.00)){
brightness = 255;
fadeTimer = millis();
}
if(brightness > 1){
if(millis() - fadeTimer > fadeWait){
brightness = brightness*fade;
if(brightness <= 1){
brightness = 0;
}
fadeTimer = millis();
}
}
for(byte i = 0; i < NUM_LEDS; i++){
leds[i] = CHSV(hue, 255, brightness);
}
}
FastLED.show( CRGB::Black);