Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help with getComponentText and getComponentValue #41

Open
talexts opened this issue Feb 24, 2019 · 1 comment
Open

Need help with getComponentText and getComponentValue #41

talexts opened this issue Feb 24, 2019 · 1 comment

Comments

@talexts
Copy link

talexts commented Feb 24, 2019

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!

@bborncr
Copy link
Owner

bborncr commented Feb 25, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants