FastLED / FastLED

The FastLED library for colored LED animation on Arduino. Please direct questions/requests for help to the FastLED Reddit community: http://fastled.io/r We'd like to use github "issues" just for tracking library bugs / enhancements.
http://fastled.io
MIT License
6.49k stars 1.65k forks source link

APA102 not working for the um_feathers2 board #1475

Open mzakharo opened 1 year ago

mzakharo commented 1 year ago

Hello,

I have had no luck getting APA102 working with 3.5 version of FastLED library on the Ultimate Maker Feather S2 board (um_feathers2). The LED just would not respond/turn on. To fix the issue, I had to modify endBoundary() function of APA102Controller inside src/chipsets.h to this:

void endBoundary(int nLeds) { int nDWords = (nLeds/32); do { mSPI.writeByte(0xFF); mSPI.writeByte(0xFF); mSPI.writeByte(0xFF); mSPI.writeByte(0xFF); } while(nDWords--); }

This sequence was taken from adafruit micropython project. After this change, APA102 is working as it should. Thoughts?

Sample code:

#include <Arduino.h>
#include <FastLED.h>
#define NUM_LEDS 1
#define DATA_PIN 40
#define CLOCK_PIN 45
CRGB leds[NUM_LEDS];

void setup() {
    FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR>(leds, NUM_LEDS);
}

void loop() {
  leds[0] = CRGB::Blue;
  FastLED.show();
  delay(1000);
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(1000);

}

PlatformIO config

[env:um_feathers2]
platform = espressif32
board = um_feathers2
framework = arduino
monitor_speed = 115200
lib_deps =
    fastled/FastLED@3.5.0
zackees commented 2 months ago

Is this fixed?