How to light up leds sequentially using Adafruit?

Hi!

Im looking for a solution to how turn as many leds as I want by turning the potentiometer just like in this video but instead of pololu library I want to use neopixel library (because it will be only a function of my program that is using neopixel everywhere).

Someone has an ideo how to do it?

I don't do videos, sorry. Assuming that you're talking about the neopixel library, the below loop() function is based on the 'simple' example that comes with the neopixel library.

void loop()
{
  // read potentiometer
  int reading = analogRead(A0);
  // map to number of leds to switch on
  int numleds = map(reading, 0, 1023, 0, NUMPIXELS);
  

  pixels.clear(); // Set all pixel colors to 'off'
  
  // The first NeoPixel in a strand is #0, second is 1, all the way up
  // to the count of pixels minus one.
  for(int i=0; i<numleds; i++) { // For the nuber of leds that you want to switch on

    // pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
    // Here we're using a moderately bright green color:
    pixels.setPixelColor(i, pixels.Color(0, 150, 0));

    pixels.show();   // Send the updated pixel colors to the hardware.

    delay(DELAYVAL); // Pause before next pass through loop
  }
}

Code compiles but not tested.

PS
This is not a programming question as you need guidance; would have fitted better in the "project guidance" section.

The problem is that i can't use the for() loop because as I increase the number of leds that i want to turn ON the delay increases.

Skiermaxhtc:
The problem is that i can't use the for() loop because as I increase the number of leds that i want to turn ON the delay increases.

you can though the closing brace was not in the correct spot. (removed comments for sake of structure overview. Don't really want to use delay() and it can be ommited just as well

void loop()
{
  int reading = analogRead(A0);
  int numleds = map(reading, 0, 1023, 0, NUMPIXELS);
  pixels.clear(); // Set all pixel colors to 'off'
  for(int i=0; i<numleds; i++) { 
    pixels.setPixelColor(i, pixels.Color(0, 150, 0));
  }
  pixels.show(); 
  //delay(DELAYVAL);   
}