Hello,
I'm working on code for a project, for the moment I'm just trying to make a code that lights up my LED strip with a little animation.
I buyed an Arduino® UNO R4 WiFi because I'll need wifi later on.
Here is my code:
#include <Adafruit_NeoPixel.h>
#define PIN 5
#define NUM_LEDS 12
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Set all pixels to red
colorWipe(strip.Color(255, 0, 0), 50); // Red, 50 ms delay
}
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.show();
delay(wait);
}
}
I tested it on Thinkercad and in real life with an Arduino Uno R3 and it work. But when I try to use it with the arduino uno R4 it doesn't work, nothing happens, I manage to upload the code but the LED strip don't light up.
it's not a connection or soldering problem.
Does anyone have a solution?