Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Adafruit Neopixel library compatibility #65

Open
connornishijima opened this issue Jul 6, 2022 · 0 comments
Open

Add Adafruit Neopixel library compatibility #65

connornishijima opened this issue Jul 6, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@connornishijima
Copy link
Owner

Basic idea:

Provide compatibility with microcontrollers covered by the Adafruit Neopixel library, but not FastLED yet.

How:

  • If a platform unsupported by FastLED is detected, (i.e. RP2040) a compilation flag "ADAFRUIT_MODE" is defined.
  • A warning is shown during compilation that the library is in "Compatibility Mode" and performance may slightly suffer
  • FastLED.h is not included during compile. Instead, some manually curated FastLED module are included from a new file compatibility_tools.h
  • When a user specifies a FastLED detail like a CHSV color or a CRGBPalette16, these are handled by the FastLED structs and functions borrowed verbatim for the compatibility_tools.h file.
  • Upon calling pix.show(), the CRGB LED buffers are parsed into Neopixel's 32-bit color data using union for speed.
  • This converted LED array is then sent out using the underlying Neopixel library

This way, any microcontroller that the Neopixel library can work with (which FastLED can't yet) can be used in Compatibility Mode with little or no extra work by the user.

@connornishijima connornishijima added the enhancement New feature or request label Jul 6, 2022
@connornishijima connornishijima self-assigned this Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant