sorry, what type of Arduino did you used?
Dyspho:
Perry,Thanks a lot for checking the infos regarding serial ports !
Ok, so here what happened today:
I tried your code and it didn't work.
Then I decided to write a more simple sketch where I only send data because the previous one, even if it was simple too, was a bit confusing with sending and receiving data + writing many things in the monitor.
So, on the Nextion I only put a text block (t0) with written "empty" in it.
With the sketch, on launch it would write "test" in this block instead./*
This code is based on the software serial example on Arduino's website
*/
#include <SoftwareSerial.h> //Include the library
SoftwareSerial mySerial(10, 11); // RX, TX
void setup() {
Serial.begin(57600); //open the serial port
while (!Serial) { // wait for serial port to connect. Needed for native USB port only
;
}
Serial.println("Serial On"); //Print this messages when the serial port is connected
mySerial.begin(9600); // set the data rate for the SoftwareSerial port
}
void loop() { // run over and over
// Write "test" in the text box t0
mySerial.print("t0.txt=""); // Changing the value of box n1
mySerial.print("test");
mySerial.print(""");
mySerial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
mySerial.write(0xff);
mySerial.write(0xff);
}
It actually DID work ! I don't know what's the difference with the previous one, but this one worked ! Maybe you were right all along about saying the numeric block were crap ! Thanks so much for the help !! I am probably not done here yet thought haha I will try to go back to the previous sketch and make it work.