Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- String inputString = "Hello"; // a string to hold incoming data
- boolean stringComplete = false; // whether the string is complete
- #define DEBUG true // turn debug message on or off in serial
- SoftwareSerial mySerial(0, 1); // RX, TX
- //SoftwareSerial mySerial(11, 10); // RX, TX
- void setup()
- {
- Serial.begin(9600);
- // Serial.begin(115200);
- // set the data rate for the SoftwareSerial port
- mySerial.begin(115200);
- Serial.println("Hello, world?");
- mySerial.println("AT+RST");
- }
- void loop()
- {
- Serial.println("Sending an AT command...");
- mySerial.println("AT");
- delay(1000);
- while (mySerial.available()){ //Response OK if received on ESP8266 side
- String inData = mySerial.readStringUntil('\n');
- Serial.println("Got reponse from ESP8266: " + inData);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement