I’ve been trying to get a neopixel to light up on one of the other pins.
I want to use the device to just drive a few neopixels, so I figured the USB power should be sufficient.
The neopixels will not light up at all. If I switch the pin back to the onboard led it works, but one wired to the board fails.
Has anyone tried or succeeded in getting additional neopixels wired to the XIAO RP2040?
Try the following sketch.
#include <Adafruit_NeoPixel.h>
int Power = 11;
int PIN = 12;
int PIN1 = 7;
#define NUMPIXELS 1
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel pixels1(NUMPIXELS, PIN1, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin();
pinMode(Power,OUTPUT);
digitalWrite(Power, HIGH);
pixels1.begin();
}
void loop() {
pixels.setPixelColor(0, pixels.Color(255, 255, 255));
pixels.show();
delay(10);
pixels.clear();
pixels.show();
delay(400);
pixels1.setPixelColor(0, pixels1.Color(255, 255, 255));
pixels1.show();
delay(10);
pixels1.clear();
pixels1.show();
delay(1000);
}
I had the same problem but realized that the pin number is actually “D7” not just 7
so with the code that was previously posted change the pin number , Good Luck
1 Like