You can use the main UART to attach a peripheral, but it's somewhat tricky. You will get stuff printed on it at boot, so your periph better be able to ignore that. My onInit() function when using a nextion display attached to uart0 contains:
// change logging so we don't clobber the nextion display on uart0
esp8266.setLog(3); // log to memory and 2:uart0 3:uart1
console.log("Bye bye...");
Serial2.setConsole(false)
The way I use it is to upload the code using telnet, so I see the "Bye bye..." printed via telnet when I run onInit() manually. By setting Serial2 as console the characters get dropped. By not forcing the console to stick to Serial2 I can telnet into the espruino at any time and have the console back. This has worked quite well for me.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
You can use the main UART to attach a peripheral, but it's somewhat tricky. You will get stuff printed on it at boot, so your periph better be able to ignore that. My onInit() function when using a nextion display attached to uart0 contains:
The way I use it is to upload the code using telnet, so I see the "Bye bye..." printed via telnet when I run onInit() manually. By setting Serial2 as console the characters get dropped. By not forcing the console to stick to Serial2 I can telnet into the espruino at any time and have the console back. This has worked quite well for me.