Arduino errors with a MicroMod Input and Display Carrier Board, with a MicroMod ESP32 processor

I’ve been working on an Arduino sketch using the SparkFun MicroMod Input and Display Carrier Board, with a MicroMod ESP32 processor.

I’m getting the following errors:

c:\Users\Arduino\libraries\SparkFun_HyperDisplay_4DLCD-320240\src\HyperDisplay_4DLCD-320240_4WSPI.cpp: In member function ‘void LCD320240_4WSPI::setBacklight(uint8_t)’:
c:\Users\Arduino\libraries\SparkFun_HyperDisplay_4DLCD-320240\src\HyperDisplay_4DLCD-320240_4WSPI.cpp:209:9: error: ‘ledcAttachPin’ was not declared in this scope; did you mean ‘ledcAttach’?
209 | ledcAttachPin(_bl,15);
| ^~~~~~~~~~~~~
| ledcAttach
c:\Users\Arduino\libraries\SparkFun_HyperDisplay_4DLCD-320240\src\HyperDisplay_4DLCD-320240_4WSPI.cpp:210:9: error: ‘ledcSetup’ was not declared in this scope
210 | ledcSetup(15,12000,8);
| ^~~~~~~~~

exit status 1
Compilation error: exit status 1

Arduino IDE 2.2.1
MicroMod ESP32
SparkFun MicroMod Input and Display Carrier Board

Following libraries installed for the Carrier Board:
SparkFun HyperDisplay Arduino Library
SparkFun HyperDisplay ILI9341 Arduino Library
SparkFun HyperDisplay 4DLCD-320240 Arduino Library

Any suggestions as to what I’m doing wrong?

You have the right libraries…which verison of arduino are you using? It might want a downgrade to 1.8x

Usually I recommend a wipe & retry Uninstall for a fresh re-install - #4 by nzcrog - IDE 1.x - Arduino Forum just to nuke/overkill and get it going again…you can copy the arduino15 folder and save it somewhere as a backup if you need to use the other libraries (or just re-install as needed…keeps it a bit cleaner, as my folder/sub-menus grow fast!)

Thank you!!

I get the same error with 1.8.9 on another computer also.

I’m using IDE 2.2.1 I see there’s a newer version. I’ll uninstall this one and install the newer version.

Thanks again!

This is a known issue with ESP32.

These functions have been replaced starting V3.0 of the ESP32 library.
See ledcSetup with ESP32 Core V3.0.0 not work - Microcontrollers - Arduino Forum

  1. The quick workaround in the IDE/ board selection select the 2.0.17 version of the ESP32.
  2. OR Try to change \Users\Arduino\libraries\SparkFun_HyperDisplay_4DLCD-320240\src\HyperDisplay_4DLCD-320240_4WSPI.cpp:209:9 the
 ledcAttachPin(_bl,15);
 ledcSetup(15,12000,8)
 ledcWrite(15, 255-b);

to

 ledcAttach(_bl,12000,8);
 ledcWrite(_bl, 255-b);
  1. OR try to change \Users\Arduino\libraries\SparkFun_HyperDisplay_4DLCD-320240\src\HyperDisplay_4DLCD-320240_4WSPI.cpp:209:9 the
#if defined(ARDUINO_ARCH_ESP32)
	ledcAttachPin(_bl,15);
	ledcSetup(15,12000,8);
	ledcWrite(15, 255-b);
#else
	analogWrite(_bl, 255-b);
#endif

to (just forget teh whole ESP32 led approach)

analogWrite(_bl, 255-b);

1 Like