Nextion HMI with arduino

hey
I am try to read variable data from HMI to Mega 2560 and stored it value in it using Easy Nextion Library function myNex.readNumber() but i am not getting data which is stored in variable.

so plz help me.

Use code tags to format code for the forum
#include <EasyNextionLibrary.h>
#include <trigger.h>

EasyNex myNex(Serial);

uint32_t Sitering_Temp = 0,DummyCycle_Temp = 0;
uint32_t STemp = 0,DTemp = 0;

#define loop_time 2000
unsigned long timer;

void setup() {
// put your setup code here, to run once:
//Serial.begin(9600);
myNex.begin(9600);

delay(500);

timer = millis();
}

void loop() {
// put your main code here, to run repeatedly:
// Serial.println("Hello");
if(millis() - timer > loop_time){
Sitering_Temp = myNex.readNumber("S_Temp.val");
Serial.println(Sitering_Temp);
if(Sitering_Temp != 99){
STemp = Sitering_Temp;
Serial.println("STemp:");
Serial.println(STemp);
}
else if(Sitering_Temp == 99){
Sitering_Temp = STemp;
}

  timer = millis();

}
if(millis() - timer > loop_time){
DummyCycle_Temp = myNex.readNumber("D_Temp.val");

if(DummyCycle_Temp != 99){
DTemp = DummyCycle_Temp;
Serial.println("DTemp:");
Serial.println(DTemp);
}
else if(DummyCycle_Temp == 99){
DummyCycle_Temp = DTemp;
}

timer = millis();
}

}

Moved to Displays section.... Please don't post in Uncategorized again.

Please also put your code tags, the <CODE/> button.
You can edit your post to include the above by using the little pencil in the bottom right corner.

Thanks.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.