New to ESP8266 - usart
Posted: Tue Oct 23, 2018 9:57 am
Hello, i am new to ESP8266 and new to arduino. I am using arduino IDE, ESP8266 d1 mini and usb-serial converter. What i am trying to do is send a single char from my ESP8266 to my usb-serial converter. I connected tx pin on esp8266 and rx pin on my usb-serial converter. Then i wrote this code:
This sent letter a to both serialmonitor of Arduino IDE and to my USB-Serial converter. Job well done you could say. But the problem is, i am not sure why it even sent to USB-Serial converter. I didnt define "Serial" anywhere in the code, so as far as i know Serial is a connection betwen ESP8266 and computer. Now my question is this: What code do i need to write to send letter "a" only to USB-Serial converter but NOT to Serial monitor ? I tried hardwareserial, softwareserial, pinmode, etc. but nothing seems to work.
Code: Select all
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.write("a");
delay(1000);
}
This sent letter a to both serialmonitor of Arduino IDE and to my USB-Serial converter. Job well done you could say. But the problem is, i am not sure why it even sent to USB-Serial converter. I didnt define "Serial" anywhere in the code, so as far as i know Serial is a connection betwen ESP8266 and computer. Now my question is this: What code do i need to write to send letter "a" only to USB-Serial converter but NOT to Serial monitor ? I tried hardwareserial, softwareserial, pinmode, etc. but nothing seems to work.