Hello, I am trying to use multiple adafruit RGB leds displaying different colors
I am new to coding and unsure how to add the other pins. I tried adding ledPin1 and ledPin2 to the Adafruit_NeoPixel pixels list in () however that comes as an error.
could someone please explain how can i add the other two pins?
Eventually id would also like to make these leds pulsate instead of just turning on and off.
Here is the code i have so far...
#include <Adafruit_NeoPixel.h>
const int pResistor = A0; //Sensor
int value; //SensorVal (300-800 or 0-1023)
int ledPin = 3;
int ledPin1 = 5;
int ledPin2 = 6;
int NUMPIXELS = 1;
int val;
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, ledPin, NEO_GRB + NEO_KHZ800);
void setup() {
Serial.begin(9600);
pinMode(pResistor, INPUT);
pinMode(ledPin, OUTPUT);
pixels.begin();
}
void loop() {
val = analogRead(A0);
Serial.println(val);
//Serial.write(val);
pixels.setPixelColor(0, pixels.Color(150,0,150));
pixels.setPixelColor(ledPin1, pixels.Color(150,0,150));
pixels.setPixelColor(ledPin2, pixels.Color(150,0,150));
pixels.show();
if (val < 520){
digitalWrite(ledPin, LOW); //Turn led off
}
else{
digitalWrite(ledPin, HIGH); //Turn led on
}
delay(200); //Small delay
}
Thank you for reading and if you have any advice or instruction i would greatly appreciate the help.

