i have a nextion display, and i created a keypad so that you can set an analog value and send it to Arduino so i can control the speed of a dc motor for example.
now the value is stored in a text object, from the library i found this function:
would this function (getText) get the text from the nextion display to the arduino,
and what is the correct way to use, i don't understand what is the buffer for, i did something like this, where t1 is the text object
i did something like this, where t1 is the text object
That didn't even compile, so, no that won't work.
The method writes to the buffer you supply, and returns some apparently useless value. You'd need to track down what recvRetString() returned to find out whether the value is actually useful, or not.
You must allocate an array, and pass the address (by specifying the name of the array) to that function.
It returns the length of the string read, in case you can’t figure that out by using strlen().
Stupid code. There is no excuse for goto and labels in C++ code. That code was obviously written by someone that barely got a passing grade in whatever programming course they cheated their way through.