Start a new topic

Waveform syntax

For me it's not clear how to add data to a waveform. I am not using the Arduino lib, but send the commands with printf.


On Nextion in page6 I have a waveform with the objname=s0 and selected 2 channels by ch=2.


void NextionSend (char* cmd) {
  printf("%s\xFF\xFF\xFF",cmd);
}


char cmd[20] = "add s0,1,30";

NextionSend(cmd);


All in a loop to get a horizontal line on level 30, but... nothing shows up.


What I am doing wrong? All other commands are working fine. Wrong syntax?


Thanks and regards.


2 people like this idea

I was confused by that too.  In the first parameter of the command, you do not supply the waveform control's *name*, you need to send its *index* which is a number.  It'll be shown in the designer when that control is selected.  Also just FYI the channel numbers appear to start a 0, not 1.

 

@Eric Thanks for the help, it's working. Strange that they don't use the symbolic id. But now I have another question: do you know something about the dimensions of the axis? What's the resolution horizontal and vertical, depends it of the size of the waveform object? It seams that way. It would be easier 0..100%, the Nextion can do the scaling.

 

hi there, can u put the code here? i really need help, i did what u do but, it doesnt work for me

Login or Signup to post a comment