Hi everyone. This is my first time writing in this forum. My name is Angelo, I am a mechanical engineer and I am recently approaching the world of Arduino. The problem I'm having is using a Nextion screen with Ardino Giga R1 Wifi. A few weeks ago I created a program that worked correctly with Arduino Uno but I can't load the same program on the Giga R1 wifi card. As far as I understand, the problem should be linked to the "Nextion.h" library because when I try to include it in any program running on the Giga 1 it gives me an error. I thank anyone who can give me a hand.
This is the sketch:
#include <Nextion.h>
#include <DHT.h>
#define DHT1_PIN 10
#define DHT1_TYPE DHT22
DHT dht1(DHT1_PIN, DHT1_TYPE);
NexText t1 = NexText(0, 3, "t1");
NexText h1 = NexText(0, 5, "t3");
void setup() {
Serial.begin(9600);
dht1.begin();
nexInit();
}
void loop() {
float temp1 = dht1.readTemperature();
float hum1 = dht1.readHumidity();
char temp1Str[6];
char hum1Str[6];
dtostrf(temp1, 5, 1, temp1Str);
dtostrf(hum1, 5, 1, hum1Str);
t1.setText(temp1Str);
h1.setText(hum1Str);
delay(500);
}
You will not find much support on this forum for using Nextion.h library.
Either use the methods of Perry Bebbington presented here
https://forum.arduino.cc/t/using-nextion-displays-with-arduino/580289
or alternatively the Easy Nextion Library by Seithan
https://www.arduino.cc/reference/en/libraries/easy-nextion-library/
https://github.com/Seithan/EasyNextionLibrary/blob/master/src/EasyNextionLibrary.h
The Giga R1 has multiple hardware serial ports, and using Software Serial should not be used,
A thousand thanks. your suggestion was very helpful, I think with these tutorials I will be able to solve my problem
Hi. Were you able to use the EasyNextion library with Giga? I could not send data.