Start a new topic

Writing data to text box

I have loaded the program where you click a button on the screen and the number changes in a text box and it works fine.


I have a DHT11 connected to my Mega and am trying to figure out how to write the data from the DHT11 to the textbox without having to click any buttons.


Could anyone provide a simple sketch how to write data to a textbox on the Nextion?


Thank you


John307


@amith are you Serious?

Who can possibly know when there is no details you provide?

Mindreading is usually a local thing - limited to 15 feet or approx. 4.5 metres.

Do you see anyone here in the room with you?  Then mindreading is out.


Do NOT dump your error log - I will not read - it is for you a must to read.

Refer to thread here to see how you can identify cause of error

 http://support.iteadstudio.com/support/discussions/topics/11000012054

You must learn about the things you wish to play with

- You must learn your programming Language

- You must learn your compiler

- You must learn your IDE and how to debug to find your errors and causes.

- You must learn your microprocessor, its capabilities and its limits


If library is Iteadlib,Arduino Nextion Library

  If programming Language is Arduino C++

    If compiler is Arduino GCC in Arduino IDE

       If microprocessor board is of type AVR

Then a possibility exists that you can read the NexText.h/.cpp source code files

 and by reading the source understand what is happening so through this new

 understanding you might see what it expects as parameter, and why it fails.

     Does parameter say String?  or does it not say char *buffer.


But it is you who must read to learn. In learning you will find success



Hello

I'm trying to send the reading of an ultrasonic sensor to a nextion .txt.

The problem is that the nextion only shows the first data taken and does not update the following data.

Any suggestions for this problem ... thx 

void ultrasonido()
{          
 memset(buffer, 0, sizeof(buffer));
 memset(buffer_ultrasonico, 0, sizeof(buffer_ultrasonico));
 itoa(sensor, buffer, 10);
 if (strcmp(buffer, buffer_ultrasonico))
   {
     Centimetros.setText(buffer);
     strcpy(buffer_ultrasonico, buffer);
   }
  delay(100);
 }

  

@jamil


Your code example shows no sign of debug output

 - try sending the same in hex to a terminal and see exactly what you send


No idea which library you are attempting to use, straight C, C++, Arduino C++?

 - can not mind-read.  You don't provide enough details.

.txt attribute is updated by sending t0.txt="Hello World"ÿÿÿ

Be certain your output meets this requirement


Use of a 100ms delay also can cause issues - stop processing for 100ms.


Login or Signup to post a comment