NodeMCU V3 how to refer to pins GPIOxx

Hi, I need to use as digital ouputs the pins GPIO12 and GPIO13
How can I define them in the sketch?
I'd like to have:

#define TEST GPIO12
#define CONTROL GPIO13

as I normally do for the Dx pins:

//pins
#define IRQ1PIN D5
#define IRQ2PIN D6
#define IRQ3PIN D7

but the IDE does not recognize this syntax.
Thanks

just specify the GPIO number, e.g.

#define TEST 12
#define CONTROL 13
1 Like

Was so simple ?
Well, thanks

Or use their NodeMCU names: D6 and D7

From "variants/nodemcu/pins_arduino.h"

static const uint8_t D0   = 16;
static const uint8_t D1   = 5;
static const uint8_t D2   = 4;
static const uint8_t D3   = 0;
static const uint8_t D4   = 2;
static const uint8_t D5   = 14;
static const uint8_t D6   = 12;
static const uint8_t D7   = 13;
static const uint8_t D8   = 15;
static const uint8_t D9   = 3;
static const uint8_t D10  = 1;

Yes, I knew this, but the question was different and bad stated.
I want to refer to pins that are not in the D series, like the GPIO6, GPIO7 and GPI11 which, from @horace answer I can simply define as 6,7, 11, but... I Just discovered that I can not use these pins; actually, as soon as I configure them, i.e.

#define IO7 7
pinMode(IO7, OUTPUT);

I get a WDT timeout crash.

At the end of 16 digital IO pins I can only safely use 7 of them:
2 for I2C (D1, D2), 4 for my I/O (D5..D8), 1 (D4) for TXD1; I miss one pin for output.
Can I use IO16 (D0) for this? Or any other pin?

Desperatly seeking a pin !
Thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.