ESP8266 and Arduino serial communication

1. The wiring is as follows:

CH340 ESP8266 Arduino DataPin
TXD -> URXD    13
RXD -> UTXD    12
3.3V -> 3.3V    br> 3.3V -> CH_PD    3.3V
GND -> GND     GND


2. Write code

#include 

SoftwareSerial mySerial(
13, 12); // RX, TX

void setup () {
Serial.begin(115200);
Serial.println(
"Hello, serial!");

// set the data rate for the SoftwareSerial port
mySerial.begin(115200);
mySerial.println(
"AT< span style="color: #800000">");
}

void loop() {// run over and over
if (mySerial.available()) {
Serial.write(mySerial. read());
}
if (Serial.available( )) {
mySerial.write(Serial.read());
}
} Set the terminator to NL and CR, the baud rate is 115200, and you will receive it when you send AT Reply OK

#include 

SoftwareSerial mySerial(
13, 12); // RX, TX

void setup() {
Serial.begin(115200); < span style="color: #000000">
Serial.println("Hello ,serial!");

// set the data rate for the SoftwareSerial port
mySerial.begin(115200);
mySerial.println(
"< /span>AT");
}

< span style="color: #0000ff">void
loop() {// run over and over
if (mySerial.available()) {
Serial. write(mySerial.read());
}
if ( Serial.available()) {
mySerial.write(Serial.read());
}
} Set the terminator to NL and CR, set the baud rate to 115200 Send AT You will receive a reply OK

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1225 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.