Grove LED Bar library modification for using with ESP32

Currently, the library available on the Seedstudio website cannot be used for the ESP32 board with the Arduino IDE. When we try to compile all the examples, many errors appear on the min and max functions in Grove_LED_bar.cpp.
You can solve all the problems by implementing parameter casting (in bold) in the function call. This file must be modified as follows:
line 97 level = max(0, min(10, (int) level));
line 117 led = max(1, min(10, (int) led));
line118 brightness = max(0, min((int) brightness, 1));
line 138 led = max(1, min(10, (int) led));

1 Like

Hi,

Thank you for sharing this information with us, but could you please share the esp32 board version, the code with errors when compiled, and the specific error information? I compiled some of the examples included in the library with XIAO ESP32S3 at esp32 2.0.17, but there is no error reported.

can you confirm you have v2.0?