Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- const byte rxPin = 2; // Wire this to Tx Pin of ESP8266
- const byte txPin = 3; // Wire this to Rx Pin of ESP8266
- // We'll use a software serial interface to connect to ESP8266
- SoftwareSerial esp8266(rxPin,txPin);
- void setup() {
- Serial.begin(9600);
- esp8266.begin(9600);
- delay(1000);
- }
- void loop() {
- Serial.println("Sending an AT commands");
- esp8266.println("AT");
- delay(30);
- while(esp8266.available()) {
- String data = esp8266.readStringUntil('\n');
- Serial.println("Got response from esp8266: " + data);
- }
- }
Add Comment
Please, Sign In to add comment