am trying to get the encoder to work to act as a brightness control and another one to control the colour of the leds and be able to save the last colour when its reset.
swift_LEDS.ino (1.15 KB)
am trying to get the encoder to work to act as a brightness control and another one to control the colour of the leds and be able to save the last colour when its reset.
swift_LEDS.ino (1.15 KB)
which part is not working?
A quick look at this part of your code
for (int a = 0; a <= NUM_LEDS; a++) {
leds[a] = CRGB(newPosition1, newPosition1, newPosition1);
FastLED.setBrightness(CRGB(newPosition2, newPosition2, newPosition2));
FastLED.show();
delay(400);
}
shows that you are running beyond the end of your led[]. They go from 0..NUM_LEDS-1 when indexing.
setBrightness() also takes a single value so why are your turning newPosition2 into a CRGB and then passing that?
newPosition1 and newPosition2 are not changing so why are you calling show() and delay() each time through your for loop? Did you really mean to do that or should you be iterating through your for loop and when finished, call show() and delay()?