The TJC is a Nextion but made in the Chinese Nextion factory and is in "Chinese" language but programs exactly like a US Nextion except that the overlay is not in English but the internal code is in English and Exactly like Nextion.For all intents and purposes it is a Nextion except that the HMI files are not interchangable.
https://unofficialnextion.com/t/nextion-and-tjc-whats-the-difference/20
I have found this simple code which works for me in sending both text & values(with minor code modification) from the Nextion to the Arduino and at the same time Serial Display the received text or number received to the Serial Monitor.
int aaa = 0;
int bbb = 0;
void setup() {
Serial.begin(9600);
Serial.println (" GIDDAY ");
}
void loop() {
if (Serial.available())
{
String datA = "";
delay(30);
while (Serial.available())
datA += char(Serial.read());
//Serial.println(datA);
//sendData(datA);//
aaa = datA.toInt();
if (aaa > 0) {
Serial.println(aaa);
bbb = (aaa * 12);
Serial.println (bbb);
Serial.println (" RETURN TO NEXTION");
// ,,,,,,,,,,,,,,,,,,,,, Here I am trying to change the colour of the Nextion Button from White to Red,,,,,,,,,,,,,,,,,,,,,,
//,,,,,,,,**I think my problem is here with The Serial.Print not actually going out to the Nextion. I think I somwhow nedd to**
** //,,,,,,,,create another Serial output but I am not sure how to do it.**
Serial.print("b0.pco=63488");
Serial.write(0xff);
Serial.write(0xff);
Serial.write(0xff);
}
}
}
The Code works just fine Nextion to Arduino but not the other way around.
I think i need another Serial port for Arduino to Nextion.
Can you help?