Skip to content

Commit fc7f9f5

Browse files
committed
Final review
1 parent ceaccb4 commit fc7f9f5

File tree

1 file changed

+9
-11
lines changed
  • content/hardware/03.nano/boards/nano-esp32/tutorials/pin-setup

1 file changed

+9
-11
lines changed

content/hardware/03.nano/boards/nano-esp32/tutorials/pin-setup/pin-setup.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ The [Arduino Nano ESP32](https://store.arduino.cc/nano-esp32) is a Nano form fac
1414
This means that if you want to control a pin you can simply use the pin number that is printed on the board itself:
1515

1616
```arduino
17-
// This will enable the pin marked with "8" on the board:
17+
// This will enable the pin marked with "D8" on the board:
1818
digitalWrite(8, HIGH);
1919
```
2020

2121
### Compatibility Mode
2222

23-
However, some libraries previously written for ESP32 boards (to name a few: OneWire, FastLED, ESP32Servo) don't support the pin numbers printed on the board and require you to refer to the internal microcontroller's GPIO number instead. For instance, to refer to the pin labelled "8" on the board such libraries expect you to write `17` in your code as that's the GPIO number corresponding to that pin.
23+
However, some libraries previously written for ESP32 boards (to name a few: OneWire, FastLED, ESP32Servo) don't support the pin numbers printed on the board and require you to refer to the internal microcontroller's GPIO number instead. For instance, to refer to the pin labelled "D8" on the board such libraries expect you to write `17` in your code as that's the GPIO number corresponding to that pin.
2424

2525
For this purpose, we added a compatibility mode so that you can choose which numbering scheme you want to use:
2626

2727
* when porting an existing Arduino project from another Nano board, it's convenient to use the "Arduino pin" scheme which reflects the numbers printed on the board
2828
* when using third-party libraries for ESP32, you should use the "GPIO number" scheme which corresponds to the internal numbers
2929

30-
To change this configuration, simply connect your board, go to **Tools > Pin Numbering > Select Option**. More details are available in this tutorial.
30+
To change this configuration, simply connect your board, go to **Tools > Pin Numbering** and then select your option. More details are available in this tutorial.
3131

3232
## Software & Hardware Needed
3333

@@ -41,12 +41,12 @@ So why does the Nano ESP32 pins not match the ESP32 (MCU) pins? The Nano ESP32 w
4141

4242
This makes it possible to migrate an older Nano board, to a newer generation Nano (like the Nano ESP32), without having to change your hardware setup.
4343

44-
This of course brings a separate issue, which is that by default, the Nano ESP32 does not use the ESP32's pinout. An example of this is:
45-
- Pin `2` is actually `5`
46-
- Pin `5` is actually `8`
44+
This of course brings a separate issue, which is that this numbering does not match the ESP32's native GPIO assignment. An example of this is:
45+
- Pin `2` is actually GPIO `5`
46+
- Pin `5` is actually GPIO `8`
4747
- and so on (see the full [pin map](#nano-esp32-pin-map)).
4848

49-
It is common in a board's design that the actual microcontroller's pins doesn't match the header pins.
49+
It is common in a board's design that the actual microcontroller's pins don't match the header pins.
5050

5151
### Default & Legacy Options
5252

@@ -72,18 +72,16 @@ pinMode(5, OUTPUT);
7272

7373
You can also control pins using labels such as `D0`, `D1`, `D2`. These labels are predefined in the core, and are adjusted based on what configuration you make.
7474

75-
For example, if you are using the `GPIO number (legacy)` option:
75+
For example, the following code will access the same pin, regardless of what configuration you use:
7676

7777
```arduino
7878
/*
7979
This will configure the "D2" physical pin on your board
80-
(but will internally configure pin 5 on the ESP32)
80+
(but will internally configure GPIO 5 on the ESP32)
8181
*/
8282
pinMode(D2, OUTPUT);
8383
```
8484

85-
86-
8785
## Change Pin Configuration
8886

8987
To change the pin configuration, open the Arduino IDE, and navigate to **Tools > Pin Numbering.** Here you can select between the default (Nano) and legacy (ESP32) options.

0 commit comments

Comments
 (0)