The use of the ESP8266 in the world of IoT

User avatar
By rudy
#61360 You did not say what language you are programming in. But yes you can. Just use D1 or D3 instead of say D4. Just make sure you disable the serial port function if it is enabled.
User avatar
By TarekJ
#61363
rudy wrote:You did not say what language you are programming in. But yes you can. Just use D1 or D3 instead of say D4. Just make sure you disable the serial port function if it is enabled.


I program it through Arduino IDE, I do not use lua
I did not understand what you mean by D1 or D3, please explain, can you mention a similar project or code?

Thanks
User avatar
By Barnabybear
#61364 Hi, have a look at the colourfull table about half way down this page
wiki/doku.php?id=esp8266_gpio_pin_allocations

By default the pins are as listed in the table function 0, pin 1 Tx and pin 3 Rx. You want pin 1 to be function 3 a GPIO.
You can activate any “FUNCTION” with pinMode(pin, FUNCTION1) for example.

Code: Select all// this will swap the pin to a GPIO
pinMode(1, FUNCTION3);

// this will restore the pin to Tx
pinMode(1, FUNCTION0);