I have connected the Arduinos RX,TX pins to the ESP,s TX,RX pins and the ESP receives the data i am sending but it seems to print it directly to the Serial monitor over the usb connection instead of the coding reading it ?
I have tried using if (Serial.available) and while(Serial.available) to listen to the Serial data and Serial.read to record but neither work again it just prints the data as if it is passing directly through, why is it doing this ?
#include <SoftwareSerial.h>
#include <Arduino.h>
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
#define USE_SERIAL Serial
char x = {0};
void setup() {
delay(2000);
USE_SERIAL.begin(9600);
USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println(); // idk why you need to run this 3 times, but that what i read ?
USE_SERIAL.println("\n Starting");
}
void loop() {
if (USE_SERIAL.available()) {
while (USE_SERIAL.available()) {
x = USE_SERIAL.read(); // read one character from the Serial
USE_SERIAL.print("\n recived");
USE_SERIAL.println(x);
}
}
}