Start a new topic

setText string

I have read the forum post here

but I am a little unsure of how to implement it on the arduino. 

I have an array of names stored on the arduino

User_Array [1] = Harry

User_Array [2] = Fred

User_Array [3] = Bob


Depending on what is selected I want to set the value of a variable on the nextion screen, so that I can then write it into a text field, to be one of these names

if (x = 1)




if (x = 2)




if (x = 3)




but when I try to send to the Nextion I get the variable being set to a number.

I have tried to add the quotation marks required, but this does not seem to work either.

  char copy[20];


  String blah = "\"Blah\"";



  memset(buffer, 0, sizeof(buffer)); // clear buffer

  itoa(copy, buffer, 10);


If however I type in



it works perfectly so I have got the comms working so it must be something I am doing wrong on the arduino side.


  since Indev2 gave a good answer to my modified example

  and since issue is what you are doing wrong on your Arduino mcu side

Isn't this an Arduino question or more Arduino required research?

I just thought someone could help explain it in a little simpler terms so I could learn from it.