Hey guys, Here is an another update on sending dummy sensor value and outputting the data to the Nextion Display.
SEE THE VIDEO
SENDING DATA TO NEXTION DISPLAY
So, How do one send data to sexton display using STM32,
Lets go through the Nextion instruction set where we will se that in the display there are concepts of Objects such as text object, button object , etc.
each of the objects have certain properties like colour, text, value, etc ... ..
so the way we send the values
is Obj_Name.Obj_Property=Value followed by termination charter
for example, if my number display object is n0 and it has a property value val
so the expression to be sent to Nextion display would be
n0.val=20 followed br termination sequence.
Termination Sequence
termination sequence of sexton displays is 0xFF three times , i.e. 0xFF 0xFF 0xFF
My Code implementation
Defining strings
static const char terminator = 0xFF; // Nextion termination sequence
char* dispSpeed = "n0.val="; // Nextion RIDE screen commands
char* dispAvg = "n2.val=";
char* dispDist = "n1.val=";
in functions
nextion.printf(dispSpeed); // updating Speed Value on Nextion Display
nextion.printf("%d",(int)(ridingSpeed));
nextion.printf("%c%c%c",terminator,terminator,terminator);
which successfully update the display
Thanks for reading
GS Gill