Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By raz123
#10571 Just thought I'd mention for those who land on this thread that the following define is faulty :

nicoverduin wrote:#define GPIO 0
PIN_DIR_OUTPUT = GPIO;


GPIO needs to be either 1, 2, 4, 8, etc.. depending on the GPIO you want to target.
In other words: 1 for GPIO0, 2 for GPIO1, 4 for GPIO2, etc.
User avatar
By raz123
#10900
MK1888 wrote:Doesn't it need to be OR'd with the register value?


From the OP: 'PIN_DIR_OUTPUT [...] changes the direction of the pin to an output [...] only "1" bits written will cause a change.'