Skip to content

Commit 6f68f28

Browse files
committed
Do not override currentPalette
1 parent dd3a888 commit 6f68f28

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Deevstock/DeevstockDMX/noisefire.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void noisefire() {
1212

1313
timeval = 0; // Our EVERY_N_MILLIS_I timer value.
1414

15-
currentPalette = CRGBPalette16(CHSV(0,255,2), CHSV(0,255,4), CHSV(0,255,8), CHSV(0, 255, 8), // Fire palette definition. Lower value = darker.
15+
CRGBPalette16 palette = CRGBPalette16(CHSV(0,255,2), CHSV(0,255,4), CHSV(0,255,8), CHSV(0, 255, 8), // Fire palette definition. Lower value = darker.
1616
CHSV(0, 255, 16), CRGB::Red, CRGB::Red, CRGB::Red,
1717
CRGB::DarkOrange,CRGB::DarkOrange, CRGB::Orange, CRGB::Orange,
1818
CRGB::Yellow, CRGB::Orange, CRGB::Yellow, CRGB::Yellow);
@@ -22,7 +22,7 @@ void noisefire() {
2222

2323
index = (255 - i*256/NUM_AUDIO_LEDS) * index/128; // Now we need to scale index so that it gets blacker as we get close to one of the ends
2424
// This is a simple y=mx+b equation that's been scaled. index/128 is another scaling.
25-
ledsAudio[i] = ColorFromPalette(currentPalette, index, sampleavg, NOBLEND); // With that value, look up the 8 bit colour palette value and assign it to the current LED.
25+
ledsAudio[i] = ColorFromPalette(palette, index, sampleavg, NOBLEND); // With that value, look up the 8 bit colour palette value and assign it to the current LED.
2626
} // The higher the value of i => the higher up the palette index (see palette definition).
2727
showSegments();
2828
} // noisefire()

Deevstock/DeevstockDMX/noisefiretest.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void noisefiretest() {
1212

1313
timeval = 10; // Our EVERY_N_MILLIS_I timer value.
1414

15-
currentPalette = CRGBPalette16(CHSV(0,255,2), CHSV(0,255,4), CHSV(0,255,8), CHSV(0, 255, 8), // Fire palette definition. Lower value = darker.
15+
CRGBPalette16 palette = CRGBPalette16(CHSV(0,255,2), CHSV(0,255,4), CHSV(0,255,8), CHSV(0, 255, 8), // Fire palette definition. Lower value = darker.
1616
CHSV(0, 255, 16), CRGB::Red, CRGB::Red, CRGB::Red,
1717
CRGB::DarkOrange,CRGB::DarkOrange, CRGB::Orange, CRGB::Orange,
1818
CRGB::Yellow, CRGB::Orange, CRGB::Yellow, CRGB::Yellow);
@@ -34,8 +34,8 @@ void noisefiretest() {
3434
// Serial.println(" ");
3535

3636

37-
ledsAudio[NUM_AUDIO_LEDS/2-i/2+1] = ColorFromPalette(currentPalette, index, sampleavg, NOBLEND); // With that value, look up the 8 bit colour palette value and assign it to the current LED.
38-
ledsAudio[NUM_AUDIO_LEDS/2+i/2-1] = ColorFromPalette(currentPalette, index, sampleavg, NOBLEND); // With that value, look up the 8 bit colour palette value and assign it to the current LED.
37+
ledsAudio[NUM_AUDIO_LEDS/2-i/2+1] = ColorFromPalette(palette, index, sampleavg, NOBLEND); // With that value, look up the 8 bit colour palette value and assign it to the current LED.
38+
ledsAudio[NUM_AUDIO_LEDS/2+i/2-1] = ColorFromPalette(palette, index, sampleavg, NOBLEND); // With that value, look up the 8 bit colour palette value and assign it to the current LED.
3939

4040
} // The higher the value of i => the higher up the palette index (see palette definition).
4141
showSegments();

0 commit comments

Comments
 (0)