Beginner. I have a program to control led lights on an 8 x 32 led matrix, WS2812B. When I run it on an UNO, all is well. I have an Arduino R4 also. The exact same program does not light up any lights, and the serial monitor does not function either. Even a simple serialprint program will not work on the R4, but works fine on the UNO. The R4 will run the pre-packaged examples on the onboard matrix, so there is communication. I have tried using external power source, and it does not make a difference. The pin hookups are the same, 6 pin for digital output, along with a ground and 5 v. The Led strip works fine on the Uno . Occassionally, when I put in some printlines, it will show in the serial monitor if from the main loop, but not when I put them in the set up loop. Mostly there is no response, or occassionally ???????????? printout. I am definitely using the correct Com port as the onboard matrix will work. Any help is appriciated. I did not feel a need to include the code since it works with the UNO.
I'm not familiar with the Uno R4 so most of what you described does not make sense to me; don't worry about that
I get a feeling that you have a bug in your program.
The fact that it works on an Uno R3 does not exclude the possibility that there isn't a bug in your code.
None of the programs that worked on UNO will work on the R4. Even a simple serial print like this works fine on UNO, not at all on R4:
const int LED_COUNT = 256;
const int LED_PIN = 6;
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN);
void setup() {
Serial.begin(9600);
strip.begin();
strip.show();
Serial.println("SETUP");
}
void loop() {
Serial.println("MAINLOOP");
while(1);
}
That is why I did not include the code, it seems like more of a communication issue. I was hoping someone with an R4 may have experienced something similar. `
This library is right at the top of the list of libraries that don't work with the R4 on the UNO R4 Library Compatibility page. Apparently It will compile, but not run.
I see that @KurtE has an outstanding pull request to add R4 support to the Adafruit_NeoPixel library. Perhaps you could take a look at that, if FastLED isn't an option.
Thank you. Even if I just use the following I don't get a response from the serial monitor on the R4. I think I will just the UNO for a while longer..ha
const int LED_PIN = 6;
void setup() {
Serial.begin(9600);
Serial.println("SETUP");
}
void loop() {
Serial.println("MAINLOOP");
while(1);
}
That's because by the time you've got the serial monitor up and running, the R4 has already finished printing your text. IIRC (and to be honest, I may not) the R4 does not get reset when a serial connection is opened like the R3 does, so you sketch will not restart.
Perhaps if you tried the following sketch conveniently enclosed by the <CODE/>
tag tool:
const int LED_PIN = 6;
void setup() {
Serial.begin(9600);
delay(5000);
Serial.println("SETUP");
}
void loop() {
Serial.println("MAINLOOP");
delay(1000);
}
Thank you, I will give it a try. Thanks also for subltly letting me know I should use code tags. ha
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.