logo elektroda
logo elektroda
X
logo elektroda

Video tutorial displays NEXTION

ekrzychoooo 41181 274
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #91 17743100
    pauldim
    Level 1  
    How to convert 8 checkbox objects (i.e. binary 0 or 1 field) into a binary number in the panel, e.g. 11111111 i.e. 255 in hex FF and send it to arduino?

    When I create an equation in time, it doesn't count correctly for me:
    va0.val = c0.val * 1 + c1.val * 2 + c2.val * 4 + c3.val * 8 + c4.val * 16 + c5.val * 32 + c6.val * 64 + c7.val * 128 // (where c0.val is either 0 or 1)
    n0.val = va0.val
  • ADVERTISEMENT
  • #93 17813180
    Slawek K.
    Level 35  
    sq9cyg wrote:
    Buddy "ekrzychoooo", did you manage to solve the problem from the post? https://www.elektroda.pl/rtvforum/topic3429648-60.html#17568050 ?


    It will not work for you because the "compiler" in nextion does not perform many math operations in one operation, you have to break it down into single operations.

    You have to do this:

    Video tutorial displays NEXTION
    Video tutorial displays NEXTION
    Video tutorial displays NEXTION

    You need two variables (va0 and va1):

    Code: C / C++
    Log in, to see the code


    As you can see it works fine. As for converting to hex, send dec to arduino and convert there because it doesn't matter where the conversion takes place.

    Greetings
  • #94 17826968
    czosnekltd
    Level 12  
    Hello
    I'm just starting to play with Nextion displays and I have a question:
    From what I understood, displays generally communicate with the outside world via the serial port .... But after connecting the display to the serial port, I can see on the monitor of the serial port that the messages look like "e" + "bushes". (from what I understand this is the correct form of messages in these displays).
    How (without support using the library) to send to the display from the arduino level, for example to display the next screen (page2)?
    Is it possible for messages to come to the consoles in a more readable form?
  • #95 17827232
    ekrzychoooo
    Level 17  
    czosnekltd wrote:
    Is it possible for messages to come to the consoles in a more readable form?

    I will repeat myself but it's best to use the physical display when the project is ready and everything works in NextionEditor DEBUG mode. There is a console that shows all communication between the display and the microcontroller in hex and string.
  • #96 17828919
    jacol184
    Level 11  
    I saw that you used esp, for the second week I have been trying to run the display with nodemcu, unfortunately to no avail, I care about the harware serial, unfortunately Google did not help.
    How did you configure esp to work with lcd?
  • ADVERTISEMENT
  • #97 17829343
    Slawek K.
    Level 35  
    You can connect the LCD to the Rx and Tx pins on the nodem;

    nodemcu Rx (GPIO3) to Tx on Nextion
    nodemcu Tx (GPIO1) to Rx on Nextion

    In the NexConfig.h file of the ITEADLIB library, you set it like this:

    Code: C / C++
    Log in, to see the code

    And that's it. Of course, in setup () you need to initialize Serial:

    Code: C / C++
    Log in, to see the code

    It's best to put the code you have on the nodemcu, then you will be able to find out what is wrong.

    Greetings
  • #98 17830967
    jacol184
    Level 11  
    I have configured Nextion.h according to your instructions, so far using example does not work?

    I am uploading the code that worked on MEGA2560, and I would like to use the same method to switch to ESP.
    Should the code for ESP in this configuration contain anything else?



    Code: C / C++
    Log in, to see the code
    [/ code]
  • #99 17830985
    Slawek K.
    Level 35  
    Specify what exactly is not working. This code does not send any data to the LCD. There is no loop so it's hard to check anything.

    Greetings
  • #100 17831043
    jacol184
    Level 11  
    I am putting in a sample code for ESP8266, for a test run, the idea is to display "ok" for t8, t9

    Serial Monitor in Arduino crashes the bushes "?l??`?ld?p $: I???EO?v`MM ?4C8???" baud rate 9600

    below code


    Code: C / C++
    Log in, to see the code
  • ADVERTISEMENT
  • #101 17831065
    Slawek K.
    Level 35  
    You don't need a library to send data to Nextion, it is needed to get data from Nextion.

    Do it this way :

    Code: C / C++
    Log in, to see the code
  • #102 17831075
    ekrzychoooo
    Level 17  
    jacol184
    Does esp8266 without the nextion library correctly send to the serial port?

    With this code:
    Code: C / C++
    Log in, to see the code


    you're flooding the display with data a bit. The project should be created in such a way that there is as little transmission of LCD controller as possible
    Enter what your config.h looks like

    I know delay () is pase but with such attempts add it
    Code: C / C++
    Log in, to see the code
  • #103 17831119
    jacol184
    Level 11  
    I realize, just for testing purposes the code looks like this ..

    below NexConfig.h

    Code: C / C++
    Log in, to see the code
  • #104 17831165
    Slawek K.
    Level 35  
    Change from Serial1 to Serial, as I wrote earlier, unless you connected the Rx from Nextion to D8 on the nodemcu. On ESP, the second series is "flawed", Tx only, Rx not working.

    Greetings
  • #105 17831169
    ekrzychoooo
    Level 17  
    I have mine
    Code: C / C++
    Log in, to see the code

    and I'm using ESP-12
    And I repeat my question:
    Does esp8266 without the nextion library correctly send to the serial port? Any sample test program for Serial.
  • #106 17831194
    Anonymous
    Level 1  
  • #107 17831206
    ekrzychoooo
    Level 17  
    Jarzabek666 wrote:
    Unless you have some strange libraries esp ..

    You may be right. I use Sloeber (for eclipse) for nextion and ESP.

    Added after 15 [minutes]:

    Sorry if i misled.
    WILL BE A SERIAL FOR ESP8266.
    Now I don't remember after what trials with what processor I have the last entry in nexconfig.h Serial2.
    Colleagues Jarzabek666 and rs6000 I would like to pay you back.
  • #108 17831274
    jacol184
    Level 11  
    For now, it works on Serial, so in this configuration I can forget about the tx from Nextion?
  • #109 17831339
    Slawek K.
    Level 35  
    It will work both ways on Serial, only to Nextion on Serial1.
  • ADVERTISEMENT
  • #110 17831342
    jacol184
    Level 11  
    For now, thank you for your help :-)
  • #111 17833460
    comer3
    Level 27  
    Hello,

    I am trying to buy a NEXTION 3.5 "display for one of the projects in which communication with the user must be carried out using a touch display and an interface from the PC level (computer program). Before buying, I wanted to ask my colleagues who already have this display and they support it, for example, with the arduino uno module (or a similar module equipped with one serial port) - if I understand correctly by connecting the display to arduino (RX-TX pin), and arduino to the computer, we will receive communication between the uC and the display in the console on the computer? Is it possible to implement an additional interface for control from the PC level (USB-RS communication) better / easier to use a prock equipped with two serial ports and one to operate the display and the other to communicate with the application on the computer? on one port?
  • #112 17833540
    Anonymous
    Level 1  
  • #113 17833779
    Slawek K.
    Level 35  
    On one usart it will not work properly. Choose a uC with two or more.

    Greetings
  • #114 17833887
    comer3
    Level 27  
    So I thought that there could be problems on one RS: / Another idea - if we could use the software port (Software Serial library) for communication with the PC, and the hardware RS with the uC for communication with the display?
  • #115 17833905
    Slawek K.
    Level 35  
    As a last resort, the softwareserial is lame and unstable.

    Greetings
  • #116 17835214
    comer3
    Level 27  
    OKAY. So there is a uC with min. two serial ports. Thank you for your comment.

    best regards
  • #117 17941545
    zeniuzeniu
    Level 11  
    Hello.
    I have a question, how to make a txt field on the display with the possibility of moving? I would like to show the contents of the file from the SD card connected to the arduino on the display.
  • #118 17942124
    Anonymous
    Level 1  
  • #119 17945232
    Slawek K.
    Level 35  
    zeniuzeniu wrote:
    Hello.
    I have a question, how to make a txt field on the display with the possibility of moving? I would like to show the contents of the file from the SD card connected to the arduino on the display.

    In the editor you have a component called "Scolling text". You can set the scrolling direction (left-right, right-left, up-down, down-up), scroll speed, etc.
    As for loading the contents of the file, I assume, taking into account the above, that it is a text file. The maximum number of characters in a text field is limited by the amount of memory available. Remember that you have to send the data through the series, so if there is a lot of data it may take a while.

    Greetings
  • #120 17945583
    Anonymous
    Level 1  

Topic summary

The discussion centers on creating and using video tutorials for NEXTION displays, focusing on practical implementation with Arduino and ESP8266/ESP-12 microcontrollers. Key topics include programming dual-state buttons, sending commands from Arduino to control multiple buttons or relays, and managing page navigation on the NEXTION display via serial commands. Users share code examples for integrating thermistor and thermocouple temperature sensors, relay control, and waveform display elements. Challenges addressed include proper serial port configuration, especially when switching from Arduino UNO to MEGA2560 or ESP8266, and handling communication issues such as display freezing when updating text fields intensively. The importance of correct object declarations, event handling (e.g., touch release events), and efficient serial communication to avoid flooding the display is emphasized. Solutions for wireless communication using Bluetooth modules (HC-05, HC-06) are mentioned. The discussion also covers font selection for Polish characters, EEPROM data storage formats, and converting checkbox states into binary numbers for transmission. Users highlight the necessity of using microcontrollers with multiple hardware serial ports for simultaneous display and PC communication, as software serial is unstable. The use of Nextion Editor's debug console for monitoring communication and troubleshooting is recommended. Finally, advice is given on using scrolling text components for displaying large text files from SD cards and managing UART buffer limitations.
Summary generated by the language model.
ADVERTISEMENT