- #define FASTLED_RMT_MAX_CHANNELS 1
- #define FASTLED_RMT_BUILTIN_DRIVER 1
- #define FASTLED_INTERRUPT_RETRY_COUNT 1
I have an esp32-s2-saola-1 which has an addressable RGB LED (WS2812), driven by GPIO18 as described here:
https://docs.espressif.com/projects/esp ... -v1.2.html
Problem is I haven't yet found an Arduino compatible library to drive the RGB led correctly.
As an example, using FastLED ( http://fastled.io/ ) the code below turns the led green (when it should turn it red) and then generates the following error:
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0)
and then reboots.
I suspect the led may be a GRB device, and not a RGB device as advertised, but that's not as much of a concern as the reboot.
#define LED_PIN 18
#define NUM_LEDS 1
#define BRIGHTNESS 10
#define LED_TYPE WS2812
#define FASTLED_ALLOW_INTERRUPTS 0
#include "FastLED.h"
CRGB leds[NUM_LEDS];
void setup()
{
Serial.begin(115200);
Serial.println("Starting");
delay(5000); // saftey delay
Serial.println("Started");
FastLED.addLeds<WS2812, LED_PIN, RGB>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS );
}
void loop() {
Serial.println("Red");
leds[0] = CRGB::Red;
FastLED.show(); // << failes here; have also tried FastLED.delay(100); as well as following FastLED.show(); with yield();
delay(1000);
Serial.println("Green");
leds[0] = CRGB::Green;
FastLED.show();
delay(1000);
Serial.println("Blue");
leds[0] = CRGB::Blue;
FastLED.show();
delay(1000);
}
A bunch of research and trials has me thinking the problem is tied to the esp32-s2-saola-1 being based on a single core chip, but I cannot confirm.
Would appreciate either:
a) knowing if I am missing something above
or
b) know another Arduion compatible library that allows the LED to be driven correctly.
With thanks