Hello everyone,
I don't know if I chose the best category,
I looked for a category that included WOKWI, but I couldn't find it.
When trying to help in
(ESP 32 IR Sensor control Motor) I came across a situation that I couldn't solve.
I copied the code from the topic and pasted it into the WOKWI simulator, selecting ESP32.
When compiling, the error appeared:
sketch.ino:11:3: error: 'ledcSetup' was not declared in this scope
11 | ledcSetup(0, 5000, 8); // channel 0, 5kHz, 8-bit resolution
| ^~~~~~~~~
and other errors.
I found it strange, because the syntax of line 11 was correct.
I searched the WEB and didn't find anything that would help me with the error.
So I looked for an example of WOKWI that used this function, and I found some.
I selected one, and ran it. It didn't give an error.
So I copied line 11 of the OP's code and pasted it into the example.
It gave the same type of error when running.
I removed the line but the line was blank. I ran it and it gave an error.
I removed the blank line and it ran normally.
In setup() and included a blank line and ran it. It gave an error.
I removed the line and it ran correctly.
In loop() and included a blank line and ran it. It gave an error.
I removed the line and it ran correctly.
Here's the link to the simulator.
I would like someone to run this example in the simulator and then add a
blank line anywhere in the setup() or loop() and check if it gives an error.
Thanks in advance.