I'm trying to make a serial communication between Arduino Uno and NodeMcu. This code is for the NodeMcu, I've been following tutorial but I seem to be stuck with break statement not within loop or switch error
#include <SoftwareSerial.h>
SoftwareSerial NodeMcu_SoftSerial (D1,D2);
char c;
String dataIn;
void setup() {
Serial.begin(57600);
NodeMcu_SoftSerial.begin(9600);
}
void loop() {
while(NodeMcu_SoftSerial.available()>0);
{
c = NodeMcu_SoftSerial.read();
if(c=='\n') {break;}
else {dataIn+=c;}
}
if(c=='\n')
{
Serial.println(dataIn);
c=0;
dataIn="";
}
}