The code I am using with a Nextion 3.2" is a very simple one. The display has two numeric fields and two buttons - Start and Stop. When operational all that happens is the modified Millis() value update on Display when Start is pressed. Works fine. But I want to see the data traffic on the AltSoftSerial port !! So how to copy that to the Serial() port ?? Thanks
#include "EasyNextionLibrary.h" // Include EasyNextionLibrary
#include <AltSoftSerial.h>
// The EasyNextion library is for Hardware serial. So have modified the
// EasyNextionLibrary.h and EasyNextionLibrary.cpp to use AltSoftSerial.
AltSoftSerial softSerial; // Pin 8 is Rx and 9 is Tx. Cannot change !!
EasyNex myNex(softSerial); // Create an object of EasyNex class with the name < myNex >
// Declare Variables ..
boolean upDateDisp ;
unsigned long upDateInterval = 500;
unsigned long upDateMillis = millis();
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
void setup() {
Serial.begin(9600); // For monitoring
myNex.begin(9600);
}
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
void loop() {
myNex.NextionListen(); // Required to monitor Button presses
if ( (millis() - upDateMillis ) > upDateInterval ) {
upDateMillis = millis();
if (upDateDisp) {
myNex.writeNum("F1Num.val", millis() / 100);
myNex.writeNum("F2Num.val", millis() / 1000);
}
}
}
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
void trigger0() {
upDateDisp = HIGH ;
}
//******************************************
void trigger1() {
upDateDisp = LOW ;
}
//******************************************