Hi all, we try to develop a project by using Arduino Giga R1 WiFi. According to our project, we needed to add a screen Nextion (NX8048P050-011). According to tutorials, we have some options for this as using Nextion.h and just SoftwareSerial.h. Our problem is while we download and include related SoftwareSerial library (GitHub - itead/ITEADLIB_Arduino_Nextion), we have an error like this : #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors
How can we solve this problem ? Or you can advice another solution and/or library ?
Sorry, we have new in these topic... Could you give more details ? Hardware Serial ? According to youtube videos and other source, always SoftwareSerial library is being used...
Hi again, thank you so much for your answer. Yes, i read the source and you are right... The notes that i learned, Arduino giga uses 4 different Serial communications like this :
The pins used for UART on the GIGA R1 are the following:
RX0 - D0
TX0 - D1
RX1 - D19
TX1 - D18
RX2 - 17
TX2 - 16
RX3 - 15
TX3 - 14
Serial.begin(9600); //initialize serial communication over USB
Serial1.begin(9600); //initialize serial communication on RX0/TX0
Serial2.begin(9600); //initialize serial communication on RX1/TX1
Serial3.begin(9600); //initialize serial communication on RX2/TX2
Serial4.begin(9600); //initialize serial communication on RX3/TX3
For basic tests, i tried to use Serial4 (RX3: 15 & TX3:14). I wrote the basic code like this for sending simple command to Nextion :
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial4.begin(9600);
while(!Serial) continue;
while(!Serial4) continue;
Serial.print("Serial Start");
Serial4.print("welcome_scr.ws_info_txtbox.txt=\"HELLO\"");
Serial4.write(0xff);
Serial4.write(0xff);
Serial4.write(0xff);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("COMMAND SEND");
delay(1000);
Serial4.print("welcome_scr.ws_info_txtbox.txt=\"HELLO\"");
Serial4.write(0xff);
Serial4.write(0xff);
Serial4.write(0xff);
}
But nothing was sent to Nextion device (I just want to update textbox value for example).
Where i do wrong ? Baudrate etc etc. i tried everything.
Thanks a lot for your attentions and helps... (By the way, i am new in these devices, please forgive me for asking non professional questions...)
I am describing the solution for Arduino Giga and like Arduino Giga devices...
According to my last comment, check if your device has single Serial Communication (just one RX and TX port) or more Serial Communication ports as I wrote that referenced in Arduino Giga datasheet.
Then for basic level developer, please check cables are on right ports. For instance, for Arduino Giga, Nextion's red cable is on +5V, black cable is on GND (you may want to connect them for power on a USB cable 5V 1A), yellow cable is on RX and blue cable is on TX.
Again according to my device setup, I selected Serial1 connection. You can use other Serial2, Serial3 and Serial4. Bu then please do not forget to connect cables on related pins. Check these reference again :
The pins used for UART on the GIGA R1 are the following:
RX0 - D0
TX0 - D1
RX1 - D19
TX1 - D18
RX2 - 17
TX2 - 16
RX3 - 15
TX3 - 14
Serial.begin(9600); //initialize serial communication over USB
Serial1.begin(9600); //initialize serial communication on RX0/TX0
Serial2.begin(9600); //initialize serial communication on RX1/TX1
Serial3.begin(9600); //initialize serial communication on RX2/TX2
Serial4.begin(9600); //initialize serial communication on RX3/TX3
void setup() {
// put your setup code here, to run once:
Serial1.begin(9600); //Set the baudrate for Nextion
while(!Serial1) continue;
}
void loop() {
// put your main code here, to run repeatedly:
//Send variable value or static value to the target object on related scene
Serial1.print("test_scene.test_textbox.txt=\"HELLO WORLD\"");
//The following 0xff is for finalizing for each command on RX
Serial1.write(0xff);
Serial1.write(0xff);
Serial1.write(0xff);
}
//Send variable value or static value to the target object on related scene
Serial1.print("test_scene.test_textbox.txt=\"HELLO\rWORLD\"");
//The following 0xff is for finalizing for each command on RX
Serial1.write(0xff);
Serial1.write(0xff);
Serial1.write(0xff);