While I am sure my Nextion and Arduino codes are wrong ,I am looking for some way to display
the data received on the Arduino so I can see where I am going wrong. Similar to the Arduino Serial.print command which displays to the Serial monitor.
Attached are HMI and Arduino codes.
tvoid setup()
{
Serial.begin(9600);
pinMode(8, OUTPUT);
digitalWrite(8,HIGH);
delay (2000);
digitalWrite(8,LOW);
}
void loop()
{
String Data_From_Display = "";
if(Serial.available())
{
String Data_From_Display = "";
delay(100);
while(Serial.available())
{
Data_From_Display += char(Serial.read());
}
if( Data_From_Display == "ON")
{ digitalWrite(8,HIGH);}
else if( Data_From_Display == "OFF")
{ digitalWrite(8,LOW); }
else
{
Serial.print("page0.t0.txt=" + String('"') + Data_From_Display + String('"'));
Serial.write(0xff);
Serial.write(0xff);
Serial.write(0xff);
}
}
delay(2000);
}ype or paste code here
What I am after is some way I can Serial.print to the Serial Monitor to show me what I have
received from the Nextion.
