nextion icon indicating copy to clipboard operation
nextion copied to clipboard

Need help with getComponentText and getComponentValue

Open talexts opened this issue 6 years ago • 1 comments

Please help me figure it out. The display has n0=0 and t0=text. I use `#include <SoftwareSerial.h> #include <Nextion.h> SoftwareSerial nextion(17, 16); Nextion myNextion(nextion, 9600);

int recc; String id, mess;

void setup() { Serial.begin(9600); myNextion.init();

} void loop() {

mess = myNextion.getComponentText("t0"); Serial.print("mess: "); Serial.println(mess);

delay(1000);

recc = myNextion.getComponentValue("n0"); Serial.print("recc: "); Serial.println(recc);

delay(1000); }`

And I get mess: 1a recc: -1 Tell me what I'm doing wrong. I want to get at least a text. Thank you!

talexts avatar Feb 24 '19 08:02 talexts

There should be no delay()s in loop(). Use the examples to get started (ReceiveMessages.ino).

bborncr avatar Feb 25 '19 12:02 bborncr