Hello, I'm currently trying to run the github example found at https://github.com/hpwit/fastled-esp32-16PINS but get

Hello,

I’m currently trying to run the github example found at GitHub - hpwit/fastled-esp32-16PINS but get two compile error.

////////////////////
Arduino/libraries/fastled-esp32-16PINS-master/platforms/esp/32/clockless_block_esp32.h:130:18: warning: unused variable ‘ert’ [-Wunused-variable]
uint32_t ert=0;
^
cc1plus: some warnings being treated as errors

exit status 1
no matching function for call to ‘CHSV::CHSV(complex int, int, int)’

/////////////////////

I’am not able to dive in core code and wonder if the real issue may comes from my sketch below. Has anybody achieved to run the @Yves_BAZIN code ?

//_______________________________________________
//parallel data output on ESP32

//strip / GPIO
//1 12
//2 13
//3 14
//4 15
//5 16
//6 17
//7 2
//8 4

// – The core to run FastLED.show()
#define FASTLED_ALLOW_INTERRUPTS 0
#include “FastLED.h”
#define FASTLED_USING_NAMESPACE
#define FASTLED_SHOW_CORE 0

#define NUM_STRIPS 8 // Ici j’utilise 8 strips
#define NUM_LEDS_PER_STRIP 60

// 8 strips enabled on GPIO 2, 4 12, 13 ,14 ,15, 16, 17 - bit mask right to left
#define PORT_MASK 0b0000000000000011111100000001010

/*THIS IS THE NEW POINT THIS MASK REFER TO THE PIN O(lowest bit) TO 31 (significant bit)
if you want 5 STRIPS on pins 2 6 12 16 19 the MASK will look like THIS
0b1001000100000100010 set NUM_STRIPS to 11

*/
#define NUM_LEDS NUM_STRIPS * NUM_LEDS_PER_STRIP
CRGB leds[NUM_LEDS];

// – Task handles for use in the notifications
static TaskHandle_t FastLEDshowTaskHandle = 0;
static TaskHandle_t userTaskHandle = 0;

void FastLEDshowESP32() {
if (userTaskHandle == 0) {
const TickType_t xMaxBlockTime = pdMS_TO_TICKS(200);

// – Store the handle of the current task, so that the show task can notify it when it’s done
userTaskHandle = xTaskGetCurrentTaskHandle();

// – Trigger the show task
xTaskNotifyGive(FastLEDshowTaskHandle);

// – Wait to be notified that it’s done
ulTaskNotifyTake(pdTRUE,portMAX_DELAY); userTaskHandle = 0;
}
}

void FastLEDshowTask(void *pvParameters) {
const TickType_t xMaxBlockTime = pdMS_TO_TICKS(500);
// – Run forever… for(;:wink: {
// – Wait for the trigger
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);

// – Do the show (synchronously)
FastLED.show();

// – Notify the calling task
xTaskNotifyGive(userTaskHandle);
}

//Then add code to initialize the task in your setup() function:
void setup(){
// – Create the FastLED show task
xTaskCreatePinnedToCore(FastLEDshowTask, “FastLEDshowTask”, 2048, NULL, 2, &FastLEDshowTaskHandle, FASTLED_SHOW_CORE);

//-- Initiate the Leds.
/* two choices use the PORT_MASK or use the hardcoded FOR Harcoded just PORT_MASK=0
it’s a bit faster because i have hardcoded the way the bit are encoded
when you use the PORT_MASK it’s a bit slower bit still good you can use two setups
WS2811_PORTA (less artifacts with hardcoded pins) or WS2812B_PORTA a new one a bit slower
i have better result for non hardcoded up to you to test the different combination. */

//FastLED.addLeds<WS2811_PORTA,NUM_STRIPS,PORT_MASK>(leds, NUM_LEDS_PER_STRIP); //
//OR

FastLED.addLeds<WS2812B_PORTA,NUM_STRIPS,PORT_MASK>(leds, NUM_LEDS_PER_STRIP); //

}

//Finally, call the new show function in place of regular show:

void loop(){
static uint8_t hue = 0;
for(int i = 0; i < NUM_STRIPS; i++) {
for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32i) + hue+j,192,255);
}
}

// Set the first n leds on each strip to show which strip it is
for(int i = 0; i < NUM_STRIPS; i++) {
for(int j = 0; j <= i; j++) {
leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
}
}

hue++;

// send the ‘leds’ array out to the actual LED strip
FastLEDshowESP32(); // FastLED.show();
}

@Derrick_Giscloux
replace "CHSV((32i) + hue+j,192,255); " by
"CHSV((32*i) + hue+j,192,255); "

@Derrick_Giscloux , you probably also need to modify your loops…

void loop(){
static uint8_t hue = 0;
for(int i = 0; i < NUM_STRIPS -1 ; i++) {
for(int j = 0; j < NUM_LEDS_PER_STRIP -1; j++) {
leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32i) + hue+j,192,255);
}
}

// Set the first n leds on each strip to show which strip it is
for(int i = 0; i < NUM_STRIPS-1; i++) {
for(int j = 0; j <= i; j++) {
leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
}
}

hue++;

// send the ‘leds’ array out to the actual LED strip
FastLEDshowESP32(); // FastLED.show();
}

Yes indeed I tryed before that but the first part of the error compilation keep going. I try again

@Jeremy_Spencer you’re right strip #1 starts at index 0.
@Yves_BAZIN error keep going after i*32 modification, I still get the :

Arduino/libraries/fastled-esp32-16PINS-master/platforms/esp/32/clockless_block_esp32.h:130:18: warning: unused variable ‘ert’ [Wunused-variable]
uint32_t ert=0;-
^
cc1plus: some warnings being treated as errors

The code on github was not very clear and I had to put it back line by line. So the debugger is probably confuse with my sketch? –

Am I wrong here:

//Let see if it works w/8 strips-
//strip / GPIO
//1 12
//2 13
//3 14
//4 15
//5 16
//6 17
//7 2
//8 4

// – The core to run FastLED.show()
#define FASTLED_ALLOW_INTERRUPTS 0
#include “FastLED.h”
#define FASTLED_USING_NAMESPACE
#define FASTLED_SHOW_CORE 0

#define NUM_STRIPS 8 // Ici j’utilise 8 strips
#define NUM_LEDS_PER_STRIP 60

// 8 strips enabled on GPIO 2, 4 12, 13 ,14 ,15, 16, 17 - bit mask right to left
#define PORT_MASK 0b0000000000000011111100000001010

/THIS IS THE NEW POINT THIS MASK REFER TO THE PIN O(lowest bit) TO 31 (significant bit)
if you want 5 STRIPS on pins 2 6 12 16 19 the MASK will look like THIS

  • 0b1001000100000100010 set NUM_STRIPS to 11*

/
#define NUM_LEDS NUM_STRIPS * NUM_LEDS_PER_STRIP
CRGB leds[NUM_LEDS];

// – Task handles for use in the notifications
static TaskHandle_t FastLEDshowTaskHandle = 0;
static TaskHandle_t userTaskHandle = 0;

void FastLEDshowESP32() {
if (userTaskHandle == 0) {
const TickType_t xMaxBlockTime = pdMS_TO_TICKS(200);

// – Store the handle of the current task, so that the show task can notify it when it’s done
userTaskHandle = xTaskGetCurrentTaskHandle();

// – Trigger the show task
xTaskNotifyGive(FastLEDshowTaskHandle);

// – Wait to be notified that it’s done
ulTaskNotifyTake(pdTRUE,portMAX_DELAY); userTaskHandle = 0;
}
}

void FastLEDshowTask(void pvParameters) {
const TickType_t xMaxBlockTime = pdMS_TO_TICKS(500);
// – Run forever… for(;:wink: {
// – Wait for the trigger
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);

  • // – Do the show (synchronously)
    FastLED.show();*
  • // – Notify the calling task
    xTaskNotifyGive(userTaskHandle);
    }*

//Then add code to initialize the task in your setup() function:*
void setup(){
// – Create the FastLED show task
xTaskCreatePinnedToCore(FastLEDshowTask, “FastLEDshowTask”, 2048, NULL, 2, &FastLEDshowTaskHandle, FASTLED_SHOW_CORE);

//-- Initiate the Leds.
/ two choices use the PORT_MASK or use the hardcoded FOR Harcoded just PORT_MASK=0
it’s a bit faster because i have hardcoded the way the bit are encoded
when you use the PORT_MASK it’s a bit slower bit still good you can use two setups
WS2811_PORTA (less artifacts with hardcoded pins) or WS2812B_PORTA a new one a bit slower
i have better result for non hardcoded up to you to test the different combination. */

//FastLED.addLeds<WS2811_PORTA,NUM_STRIPS,PORT_MASK>(leds, NUM_LEDS_PER_STRIP); //
//OR

FastLED.addLeds<WS2812B_PORTA,NUM_STRIPS,PORT_MASK>(leds, NUM_LEDS_PER_STRIP); //

}

//Finally, call the new show function in place of regular show:

void loop(){
static uint8_t hue = 0;
for(int i = 0; i < NUM_STRIPS-1; i++) {
for(int j = 0; j < NUM_LEDS_PER_STRIP-1; j++) {
leds[(iNUM_LEDS_PER_STRIP) + j] = CHSV((32i) + hue+j,192,255);
}
}

// Set the first n leds on each strip to show which strip it is
for(int i = 0; i < NUM_STRIPS-1; i++) {
for(int j = 0; j <= i; j++) {
leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
}
}

hue++;

// send the ‘leds’ array out to the actual LED strip
FastLEDshowESP32(); // FastLED.show();
}

@Derrick_Giscloux
iof the CHSV error is not there anymore you should be able to complie the code. otherwise :
look for the file /platforms/esp/32/clockless_block_esp32.h
and comment line 130
// uint32_t ert=0;
this warning should not prevent you from compiling

@Derrick_Giscloux hello i have recompile the code doing a copy paste of your Code and correcting the 32*I and it compiles without issue I am using Arduino 1.8.5

@Yves_BAZIN Mmmm… ok could you please send me the code you achieve to compile :slight_smile: ? derrickgiscloux@gmail.com

@Derrick_Giscloux i am at work now so when back home around 6pm European time

@Derrick_Giscloux did you comment the line as I wrote ?

@Yves_BAZIN No problem and Yes of course. I usually investigate :slight_smile: I’m really thinking there are issue with the board I bought. I can be wrong cause I’m a newbie in MC. What ESP32 model do you use?

@Derrick_Giscloux i am using the espressif devkit board. With which board do u compile ?

@Yves_BAZIN I have something that appears to be a lolin lite and a lolin32 classic. But I’m quite sure now there are not real Wemos. Nothing works as it should. I get no issues with my old NodeMCU 0.9

@Derrick_Giscloux hello code sent I have compiled it also suing WEMO lolin32. which version of Arduino are you using ? and the latest version of https://github.com/espressif/arduino-esp32 maybe that’s is where the issue is coming from