You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm using apa102 led strip, 60 leds.
I can't get hardware spi to work correctly on arduino due!
The goal is to get fastest refresh rate as possible.
I have already tested code on arduino mega hardware spi, and it works fine, also when i force software spi on due again everything works fine on scl and mosi (75,76)pins. But when i try to use hardware spi, the strip shows garbage(blinking or static green leds).. even when i set fastLED spi mhz to 1.
I have even tried to modify some library data, and
when I edit fastspi_arm_sam.h file (~23 line) and change "bits" value to 16, then dues hardware spi starts to work, but slower than using software spi...
Can someone help me with this situation! Thank you :) !
test code:
#define FASTLED_FORCE_SOFTWARE_SPI
#include <FastLED.h>
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
void setup() {
//FastLED.addLeds<APA102, SPI_DATA, SPI_CLOCK, RGB, DATA_RATE_MHZ(24)>(leds, NUM_LEDS);
FastLED.addLeds<APA102, SPI_DATA, SPI_CLOCK, RGB>(leds, NUM_LEDS);
FastLED.setBrightness(15);
}
void loop() {
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(255, 0, 0);
FastLED.show(); }
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(0, 255, 0);
FastLED.show(); }
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(0, 0, 255);
FastLED.show();}
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(0, 0, 0);
FastLED.show(); }}
Activity