0

WiFiNINA and Neopixel or FastLED incompatible?
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

WiFiNINA and Neopixel or FastLED incompatible?

by Systembolaget on Mon May 17, 2021 3:35 pm

Adafruit Metro Mini, Adafruit NeoPixel Ring 24 x 5050 RGB LED, Adafruit AirLift FeatherWing ESP32, DFrobot Gravity: Analog Sound Level Meter, free AIO subscription

#include <SPI.h>
#include <WiFiNINA.h> // Adafruit fork
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#include "FastLED.h" // or #include <Adafruit_NeoPixel.h>

On the above set-up, no wiring changed, I can either run the code that illuminates the LED ring based on decibel values or run the code that transmits decibel values to AIO. As soon as WiFiNINA, Adafruit_MQTT.h and Adafruit_MQTT_Client.h are in the mix, the code hangs in setup(). In other words, I cannot have the LED ring respond while TXing data.

Is WiFiNINA incompatible with Adafruit_NeoPixel.h and FastLED.h? If so, is there a good workaround?

Thanks!

Systembolaget
 
Posts: 280
Joined: Wed Mar 08, 2017 1:01 pm

Re: WiFiNINA and Neopixel or FastLED incompatible?

by blnkjns on Mon May 17, 2021 4:20 pm

I get the feeling that both libraries depend on the same timer interrupt. Fixing it is not easy, you should dive into the NeoPixel code and the available timers on the 328, and see if you can adjust a library to move to another timer. The thing is, the 328 only has 3, so they are probably all in use.
Do you mind throwing in another microcontroller, either as replacement to the 328, or as add-on, just to be a driver for the Pixels?

blnkjns
 
Posts: 610
Joined: Fri Oct 02, 2020 3:33 am

Re: WiFiNINA and Neopixel or FastLED incompatible?

by Systembolaget on Mon May 17, 2021 6:25 pm

Thanks!

Timers... modifications... that sounds rather... involved : (

Problem is I have several of these set-ups ready to be used in an underground station. I was not aware that WiFiNINA and RGB LED libraries can't work together.

What low-cost uC would you suggest as Metro Mini alternative?

Systembolaget
 
Posts: 280
Joined: Wed Mar 08, 2017 1:01 pm

Re: WiFiNINA and Neopixel or FastLED incompatible?

by blnkjns on Tue May 18, 2021 12:19 am

What is the stuff you want to display? Maybe you can offload the displaying to a second Metro, or any other cheap board, and feed "what to display" over I2C.
Which of the following things are in use:
- UART (TX/RX communication)
- I2C (Something on the SDA/SCL pins, or on A4/A5)
- millis() or micros() in code
- PWM (for dimming LED's or making sound)

blnkjns
 
Posts: 610
Joined: Fri Oct 02, 2020 3:33 am

Re: WiFiNINA and Neopixel or FastLED incompatible?

by Systembolaget on Tue May 18, 2021 1:42 am

Yeah, after reading on the Arduino forum, it looks like WiFiNINA is incompatible, so I may need a 2nd device. Another Metro Mini that does only the RGB LED driving. Seems overkill though.

Currently in use on the Metro Mini are:

pin A0 (decibel meter outputs 0,6 - 2,6V)
pin A1 (potentiometer)
pin A2 (potentiometer)
pin 2, 3, 4 (AirLift FeatherWing CS, RST, BUSY)
pin 6 (NeoPixel ring)
pin 11, 12, 13 (AirLift FeatherWing SCK, MOSI, MISO)
millis() based timing for MQTT publishing, LED ring decibel peak hold LED display functionality, AirLift FeatherWing status-LED signals

Systembolaget
 
Posts: 280
Joined: Wed Mar 08, 2017 1:01 pm

Re: WiFiNINA and Neopixel or FastLED incompatible?

by brubell on Mon May 24, 2021 10:04 am

Might want to consider a Feather M4 (SAMD21) + AirLift FeatherWing.

brubell
 
Posts: 1377
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.