Programming Multiple Neopixel Strips

Hi,

We’re trying to code a few Neopixel light strips which will change colour according to the pressure that our sensors picked up. It worked for one strip but when we wanted to add a few more, says 'expected constructor, destructor, or type conversion before ‘(’ token. The error happens for these lines:
Adafruit_NeoPixel strip;
Strip_A(LED_COUNT, LED_PIN_A, NEO_GRB + NEO_KHZ800);
Strip_B(LED_COUNT, LED_PIN_B, NEO_GRB + NEO_KHZ800);
Strip_C(LED_COUNT, LED_PIN_C, NEO_GRB + NEO_KHZ800);

Could someone please advise?

neopixel_light_test.ino (2.35 KB)

Adafruit_NeoPixel strip;

This line looks very wrong

A more typical constructor would be
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);which is taken from one of the NeoPixel examples

Are you trying to create an array of NeoPixel objects ?

Not sure about your layout and what you want to achieve but may be you should not use the Adafruit_NeoPixel library for each strip, chain them and instead use Adafruit_NeoMatrix class. Then you have one virtual long (or Tiled Matrices if you choose so) strip that you can address with one object

Also, how do I attach my code as you did so you can look at it when you are at the forum page?

See Read this before posting a programming question

I got this line:
Adafruit_NeoPixel stripB(LED_COUNT, LED_PINB, NEO_GRB + NEO_KHZ800);
from the website of the product I bought, Neopixel ADA 1376

Can you please provide a link to where you saw it ?

you should definitely read the forum rules and tips but in a nutshell, you paste your code add code tags around your code:
[code]`` [color=blue]// your code is here[/color] ``[/code].

It should look like this:// your code is here
(Also press ctrl-T (PC) or cmd-T (Mac) in the IDE before copying to indent your code properly)

there is also the [b]</>[/b] icon in the toolbar that will add the tags for you depending on how your forum settings are set and the browser you use

here is yours:

#include <Adafruit_NeoPixel.h>
#define LED_COUNT 30
#define LED_PIN_A  11
#define LED_PIN_B  9
#define LED_PIN_C  6

int sensorPin_A = A0;
int sensorPin_B = A1;
int sensorPin_C = A2;
int sensorValue = 0;
int ledValue_A;
int ledValue_B;
int ledValue_C;

Adafruit_NeoPixel strip;
Strip_A(LED_COUNT, LED_PIN_A, NEO_GRB + NEO_KHZ800);
Strip_B(LED_COUNT, LED_PIN_B, NEO_GRB + NEO_KHZ800);
Strip_C(LED_COUNT, LED_PIN_C, NEO_GRB + NEO_KHZ800);
boolean on = false ;//start with light off

void setup() {
  pinMode (sensorPin_A, INPUT); //green wire
  pinMode (sensorPin_B, INPUT); //blue wire
  pinMode (sensorPin_C, INPUT); //orange wire
  pinMode (LED_PIN_A, OUTPUT);
  pinMode (LED_PIN_B, OUTPUT);
  pinMode (LED_PIN_C, OUTPUT);
  Serial.begin(9600);
  strip.begin();
  strip.show();
}

void loop() {
  sensorValue_A = analogRead(sensorPin_A);
  sensorValue_B = analogRead(sensorPin_B);
  sensorValue_C = analogRead(sensorPin_C);
  int ledValue_A = map(analogRead(sensorPin_A), 0, 1023, 0, 255);
  int ledValue_B = map(analogRead(sensorPin_B), 0, 1023, 0, 255);
  int ledValue_C = map(analogRead(sensorPin_C), 0, 1023, 0, 255);
  Serial.print("sensorPin_A: ");
  Serial.println(sensorValue_A);
  Serial.print("sensorPin_B: ");
  Serial.println(sensorValue_B);
  Serial.print("\t ledValue_C: ");
  Serial.println(ledValue_C);
  uint32_t white = strip.Color(255, 255, 255);//setting rgb values for named colour
  uint32_t orange = strip.Color(255, 165, 0);
  uint32_t blue = strip.Color(30, 144, 255);

  if (ledValue_A >= 10 && ledValue_A <= 200) { //range for soft footstep,if satisfied led turns orange
    strip.show();
    strip.fill(orange, 0, 30);
    delay(2000);
  }

  if (ledValue_B >= 10 && ledValue_B <= 200) { //range for soft footstep,if satisfied led turns orange
    strip.show();
    strip.fill(orange, 0, 30);
    delay(2000);
  }

  if (ledValue_C >= 10 && ledValue_C <= 200) { //range for soft footstep,if satisfied led turns orange
    strip.show();
    strip.fill(orange, 0, 30);
    delay(2000);
  }

  else if (ledValue_A > 200) { //range for strong footstep,if satisfied led turns blue
    strip.show();
    strip.fill(blue, 0, 30);
  }

  else if (ledValue_B > 200) { //range for strong footstep,if satisfied led turns blue
    strip.show();
    strip.fill(blue, 0, 30);
  }

  else if (ledValue_C > 200) { //range for strong footstep,if satisfied led turns blue
    strip.show();
    strip.fill(blue, 0, 30);
  }
}