我正在一个项目中使用arduino uno和ESP8266ex作为其wifi模块。电线的连接:
Arduino 5V-> 3.3V调节器-> ESP:CH_PD(带有10k电阻)和VCC Arduino GND-> 3.3V调节器-> ESP:GND和RST(通过按钮和电阻连接复位)Arduino RX- -> ESP TX Arduino TX->分压器(2k 1k电阻)-> ESP RX 5uF电容器->电压调节器,可防止ESP自行复位。
现在,让我解释一下我遇到的问题。我有两个代码在使用ESP8266作为arduino uno的wifi模块。在我的第一个程序中,我手动发送了命令:
#define ard_rx_esp_tx 2
#define ard_tx_esp_rx 3
#include <SoftwareSerial.h>
SoftwareSerial ESPserial(ard_rx_esp_tx, ard_tx_esp_rx); // RX | TX
void setup()
{
int i = 0;
Serial.begin(9600); // communication with the host computer
while (!Serial);
// Start the software serial for communication with the ESP8266
ESPserial.begin(9600);
Serial.println("");
Serial.println(F("Remember to to set Both NL & CR in the serial monitor."));
Serial.println(F("Ready"));
Serial.println(F(""));
Serial.println(F("start")); …Run Code Online (Sandbox Code Playgroud)