Thursday, April 25, 2019

Arduino Uno + ESP8266-05 ESP-05 Test connection

Testing code for ECHO from ESP8266-05 aka ESP-05 . Check the bauds on preseted by you on ESP module.

#include <SoftwareSerial.h>
SoftwareSerial esp8266(3, 2);

String readStr;

void setup() {
  Serial.begin(74880);   
  esp8266.begin(74880);
  delay(100);
  esp8266.println("AT");
  while(!esp8266.available()) {  };
  readStr = esp8266.readString();
  Serial.print("Echo:" + readStr);
  if( readStr.indexOf("OK") > -1) {
      Serial.println("AT Command Connection : OK");
  };
}
void loop() {
}

No comments:

Post a Comment