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.
Locked
User avatar
Systembolaget
 
Posts: 335
Joined: Wed Mar 08, 2017 1:01 pm

WiFiNINA and Neopixel or FastLED incompatible?

Post by Systembolaget »

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!

User avatar
blnkjns
 
Posts: 963
Joined: Fri Oct 02, 2020 3:33 am

Re: WiFiNINA and Neopixel or FastLED incompatible?

Post by blnkjns »

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?

User avatar
Systembolaget
 
Posts: 335
Joined: Wed Mar 08, 2017 1:01 pm

Re: WiFiNINA and Neopixel or FastLED incompatible?

Post by Systembolaget »

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?

User avatar
blnkjns
 
Posts: 963
Joined: Fri Oct 02, 2020 3:33 am

Re: WiFiNINA and Neopixel or FastLED incompatible?

Post by blnkjns »

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)

User avatar
Systembolaget
 
Posts: 335
Joined: Wed Mar 08, 2017 1:01 pm

Re: WiFiNINA and Neopixel or FastLED incompatible?

Post by Systembolaget »

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

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: WiFiNINA and Neopixel or FastLED incompatible?

Post by brubell »

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

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”