Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used this about 6 months ago and it worked fine, now. . . #3

Open
bogie6040 opened this issue Nov 8, 2022 · 5 comments
Open

Used this about 6 months ago and it worked fine, now. . . #3

bogie6040 opened this issue Nov 8, 2022 · 5 comments

Comments

@bogie6040
Copy link

When compiling in Arduino IDE 2.0.1 with the latest ESP32 board drivers I now get a compile error of:
Compilation error: 'PCNT' was not declared in this scope

Which points to line 42 in the ESP32_Quad_Encoder.cpp file:
int intr_status = PCNT.int_st.val;

Any ideas how to correct this? I tried loading the latest library ESP32Encoder from madhephaestus and even downgrading to the 0.3.x versions to no avail.
Does the newer version of ESP32Encoder support directly now what your modified version was doing?

@romeo987
Copy link
Owner

romeo987 commented Nov 8, 2022 via email

@romeo987
Copy link
Owner

romeo987 commented Nov 8, 2022 via email

@bogie6040
Copy link
Author

Ok, thanks for looking at it. I will try to load an older version of the IDE - maybe that will make the original code work as it once did.

@bogie6040
Copy link
Author

Just figured out the problem I had with the "PCNT" not declared error. Here's what worked for me:
I'm using an older version of Arduino IDE (1.8.11) this may work on newer versions - I haven't tested.
The sketch will not verify (compile) unless the ESP32 board file in the Board Manager is set to 2.0.0 (some earlier versions work as well) but you can not go any newer than this version.
For Board Manager ESP32 definitions the "Additional Boards Manager URLs:" in Preferences was set to:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Hope this helps.

@vegetate7
Copy link

It compiles after adding headers into ESP32_Quad_Encoder.cpp:

#include <soc/soc_caps.h>
#include <soc/pcnt_struct.h>

Not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants