Nano ESP32: add pin numbering option #8565
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
This addresses issues faced by some Arduino customers when trying to use third party libraries designed for ESP32 targets with no pin remapping.
This changeset introduces a Pin Numbering menu option and enables it for the Arduino Nano ESP32 only. The default keeps the current Arduino pin numbered API, but when users select the "By GPIO number" option, the API will revert to the ESP32 common GPIO-based numbering for maximum compatibility with existing projects and libraries.
61d867b also fixes some compile time issues when some specific functions are called while pin remapping is enabled.
Tests scenarios
Tested with the Arduino Nano ESP32. Sketches where pins are used by symbol ("
D6
") access the same physical pins regardless of menu selection, even if the symbols have different values (Arduino pin number or GPIO number).Related links
One example of broken library is ESP32Servo which reimplements core functions such as
analogWrite()
in library files, confusing the pin remapping semantics.