How to declare a pointer for arduino neopixels library so I can set it up in the setup function with dynamic variables? I am using NeoPixel strips, and I want to be able to declare a pointer to them, but not initialize them until the setup function (because they will initialize with certain variables only made available in setup).

For simpler data types, I am just doing:

int totalNumColors = 4; //number of colors user can cycle through`
uint32_t* colorArray = new uint32_t[totalNumColors];
void setup() {
  for (int i=0;i&lt;totalNumColors;i++){
    colorArray[i] = totalColorArray[i];
  }
}


How do I do this for NeoPixel strip intializers? I tried:

Adafruit_NeoPixel* pixels = new Adafruit_Neopixel;`


but I get the error:

expected type-specifier before 'adafruit neopixel'
You can assign the pointer to NULL, and in the setup function give it a value. Note you have to add () for the arguments, even if there are none like in this case. Also you have to include the library (but probably you did but not added in your question).

#include "Adafruit_NeoPixel.h"

Adafruit_NeoPixel* pixels = NULL;

void setup() 
{
  pixels = new Adafruit_NeoPixel();
}