Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Test program to verify an ESP8266 connected to an Uno is sending and receiving commands
  • Loading branch information
FrightRisk authored Jul 20, 2020
1 parent 0fd1d64 commit 06aa5d0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/UnoWifiTest.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Basic serial communication with ESP8266
// Uses serial monitor for communication with ESP8266
//
// Pins
// Arduino pin 2 (RX) to ESP8266 TX
// Arduino pin 3 (TX) to ESP8266 RX
// Connect GND from the Arduino UNO to GND on the ESP8266
// Pull ESP8266 CH_PD (Also called EN) HIGH (3.3V)
//
// When a command is entered in to the serial monitor on the computer
// the Arduino will relay it to the ESP8266
//

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2, 3); // RX | TX Put your preferred pins here

void setup()
{
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("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");
}

void loop()
{
// listen for communication from the ESP8266 and then write it to the serial monitor
if ( ESPserial.available() ) { Serial.write( ESPserial.read() ); }

// listen for user input and send it to the ESP8266
if ( Serial.available() ) { ESPserial.write( Serial.read() ); }
}

0 comments on commit 06aa5d0

Please sign in to comment.