Potentiometer with LED Strip on arduino

Hi I need help in getting the potentiometer to work with the LED RGB STRIP, below is the code i’ve been working with. Thanks for feedback

#include <PololuLedStrip.h>
PololuLedStrip<13> ledStrip;
#define LED_COUNT 60
rgb_color colors[LED_COUNT];

// these constants won't change:
const int analogPin = A0;   // the pin that the potentiometer 

void setup() {
  // loop over the pin array and set them all to output:
  for (int thisLed = 0; thisLed < LED_COUNT; thisLed++) {
    pinMode(ledStrip[thisLed], OUTPUT); 

void loop() {
  // read the potentiometer:
  int sensorReading = analogRead(analogPin);
  // map the result to a range from 0 to the number of LEDs:
  int ledLevel = map(sensorReading, 0, 1023, 0, LED_COUNT);

  // loop over the LED array:
  for (int thisLed = 0; thisLed < LED_COUNT; thisLed++) {
    // if the array element's index is less than ledLevel,
    // turn the pin for this element on:
    if (thisLed < ledLevel) {
      digitalWrite(ledStrip[thisLed], HIGH);
    // turn off all pins higher than the ledLevel:
    else {
      digitalWrite(ledStrip[thisLed], LOW); 


I added code tags ([ code ] [ /code ] - without spaces) to your post; please use this method to post code in the future.

Which LED strip are you using? If you are using one of our LED strips, I recommend you take a look at the PololuLedStrip library examples and modify one of them to get the behavior you want.

- Amanda