#include <Adafruit_NeoPixel.h>
#include <FastLED.h>
#define PIN 11
#define Count 10
CRGB leds[Count];
Adafruit_NeoPixel light(Count, PIN, NEO_GRB);
void setup() {
FastLED.addLeds<NEOPIXEL, PIN>(leds, Count);
light.begin();
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
}
void loop() {
light.clear();
int pots = analogRead(A0);
int pots1 = analogRead(A1);
int pots2 = analogRead(A2);
int P1 = map(pots, 0, 1023, 0, Count);
int P2 = map(pots1, 0, 1023, 0, Count);
int P3 = map(pots2, 0, 1023, 0, Count);
// --------------Adafruit Count-------------------------------------------------
for(int i=0;i<P1;++i){light.setPixelColor(i, 255, 0, 0);}
for(int i=0;i<P2;++i){light.setPixelColor(i, 0, 255, 0);}
for(int i=0;i<P3;++i){light.setPixelColor(i, 0, 0, 255);}
light.show();
// --------------Adafruit RGB Brightness---------------------------------------------------
// int P1 = map(pots, 0, 1023, 0, 255);
// int P2 = map(pots1, 0, 1023, 0, 255);
// int P3 = map(pots2, 0, 1023, 0, 255);
// for(int i=0;i<P1;++i){light.setPixelColor(i, P1, P2, P3);}
// for(int i=0;i<P2;++i){light.setPixelColor(i, P1, P2, P3);}
// for(int i=0;i<P3;++i){light.setPixelColor(i, P1, P2, P3);}
// light.show();
// --------------Fastled Count------------------------------------------------------------
// for(int i=0;i<P1;i++) {leds[i] = CRGB::Red;}
// for(int i=P1;i<Count;i++) {leds[i] = CRGB::Black;}
// for(int i=0;i<P2;i++) {leds[i] = CRGB::Green;}
// for(int i=P2;i<Count;i++) {leds[i] = CRGB::Black;}
// for(int i=0;i<P3;i++) {leds[i] = CRGB::Blue;}
// for(int i=P3;i<Count;i++) {leds[i] = CRGB::Black;}
// FastLED.show(); //One time one Colour
//---------------------------------------------Blink
// leds[0] = CRGB::Red;
// leds[9].setRGB( 0, 255, 0);
// FastLED.show();
// delay(500);
}