Post topics, source code that relate to the Arduino Platform

User avatar
By martinayotte
#27943 Although I've never tried the anaologWrite() function, but I presume it assume that the pins is already in GPIO mode, which is not the case for TX pin. You probably need to switch it to alternate GPIO function before analogWrite() using something like :
Code: Select allPIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_GPIO1); // Switch TX pin to GPIO mode

Details can be found here : wiki/doku.php?id=esp8266_gpio_pin_allocations