logo elektroda
logo elektroda
X
logo elektroda

Video tutorial displays NEXTION

ekrzychoooo 40845 274
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #61 17558821
    sq9cyg
    Level 11  
    I did a temperature measurement on two dss and control two relays.
    As per comments on calling the procedure "temperatureDisplay ();" w void: loop, the relays control from the touch display works.
    But as he comments, the output control does not work ...

    Code: C / C++
    Log in, to see the code
    [/ code]
  • ADVERTISEMENT
  • #62 17558905
    ekrzychoooo
    Level 17  
    Code: Objective-C
    Log in, to see the code


    Perhaps the program gets stuck in temperatureDisplay (), specifically temp8E.setText (buffer0); temp8E on page 4 you have a button on 6.
    See the movie about global vs local.

    Added after 36 [minutes]:


    Another float conversion to ascii
    Code: C / C++
    Log in, to see the code

    here i show that is not an itoa function
  • ADVERTISEMENT
  • #63 17558989
    sq9cyg
    Level 11  
    I moved everything to one side but the same effect ...
    This is exactly where the program gets stuck :(
  • #64 17559002
    ekrzychoooo
    Level 17  
    keep moving the Serial.print ("return display"); line up until you know where they are stuck.
    Have you changed the following lines after the changes in the display?
    Code: C / C++
    Log in, to see the code
  • #65 17559314
    Anonymous
    Level 1  
  • #66 17560503
    ekrzychoooo
    Level 17  
    Quote:
    Are the GPIO versions 3.3V or 5V?

    This is what they are not making clear about. But you can call where these pins go. These displays are probably on the STM32. When you get where these pins go, you can find out from the documentation of the scalak if you can give 5V there.

    Quote:
    The second thing is why, when I set it in mode 4, it blocks my inclusion on another website?

    I don't really understand what's going on. Can you embed the hmi file?

    Quote:
    Can you connect, for example, a dth sensor to these ports? write a library on the page so that it reads directly.

    Sure it could, but it will be a BASCOM-like program or worse. (no function in these display codes). In one of the films I showed how to make a GOSUB substitute, but it can be done only temporarily.
  • #67 17563448
    sq9cyg
    Level 11  
    ekrzychoooo wrote:
    keep moving the Serial.print ("return display"); line up until you know where they are stuck.
    Have you changed the following lines after the changes in the display?
    Code: C / C++
    Log in, to see the code



    Yes, yes I changed of course that I did.
    Moving serial.print does nothing within the temperatureDisplay (); procedure.
    Through the serial port monitor, all the time the measurement is ...
    After commenting the lines //temp8E.setText(buffer0); the program is running normally. That is, the temperature is measured by the serial port monitor, you know nothing is displayed on the display, but the output control works OK.
  • #68 17563514
    ekrzychoooo
    Level 17  
    Give it a try
    temp8E.setText ("1234");
    If this works, buffer0 contains bad data (no null character to terminate text).
    In post # 62 I also wrote:
    ekrzychoooo wrote:
    Another float conversion to ascii

    Code: c [expand] [select all]

    itoa (tempC1, buffer0, 10);

    here I am showing that not an itoa function
  • ADVERTISEMENT
  • #69 17563539
    sq9cyg
    Level 11  
    ekrzychoooo wrote:
    Give it a try
    temp8E.setText ("1234");
    If this works, buffer0 contains bad data (no null character to terminate text).
    In post # 62 I also wrote:
    ekrzychoooo wrote:
    Another float conversion to ascii

    Code: c [expand] [select all]

    itoa (tempC1, buffer0, 10);

    here I am showing that not an itoa function


    Yes yes I changed it, sorry I did not write ...

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


    However, unfortunately the mere insertion of temp8E.setText ("1234"); already blocks control of relays ....
  • #70 17563582
    ekrzychoooo
    Level 17  
    Maybe it will help you
    setText function:
    Code: C / C++
    Log in, to see the code

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

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

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


    you can see that even with no response from the display, the setText function may get stuck for 100ms.

    Insert here attachment with arduino file and hmi file. Maybe I'll find some time for the test over the weekend.
  • #72 17567714
    ekrzychoooo
    Level 17  
    I don't know what arduino you are using.
    I put it on the pro-mini and wherever Serial.print is, it goes to the display and it makes one big bigos.

    For posterity:

    As you provide the arduino code to check, send the NexConfig.h file

    The configuration of uart ports depends on this file.
  • #73 17567885
    sq9cyg
    Level 11  
    Arduino mega2560.
    The mere display of the serial port on the monitor is OK ...
    Unfortunately, on the display itself, the nextion breaks; (
  • #74 17568050
    ekrzychoooo
    Level 17  
    The case turned out to be more complicated than I expected.
    If we use the ObjTXT.setText ("text") function in the program quite intensively; this is a very complicated matter. first things first.
    After starting arduino we have something like this:
    Video tutorial displays NEXTIONPrzechwyty..nie.PNG Download (23.09 kB)
    in the MCU return window you can see that arduino sends bkcmd = 1 and according to the documentation it should be 2.
    Video tutorial displays NEXTIONPrzechwyty..ie2.PNG Download (13.1 kB)
    In setup you can force it with the command:
    Code: C / C++
    Log in, to see the code

    Look at the setText function
    Code: C / C++
    Log in, to see the code

    and there is a sendCommand function that looks like this:
    Code: C / C++
    Log in, to see the code

    You can see that it "eats" the data from the input buffer.
    after pressing the button on the display, the display sends to arduino e.g. 65 04 03 00 FF FF FF
    Video tutorial displays NEXTIONPrzechwyty..ie3.PNG Download (24.91 kB)
    ie the info about a keystroke goes to arduino but gets swallowed up by the setText () function.
    The solution is, for example, displaying the temperature, e.g. every 2 seconds. Well, this is a solution called "bypass technologies" :D
    I guess these libraries should be reworked a bit because they are not perfect.
    I will think about it and speak up. Maybe a new episode on Youtube.
    And my advice is that in the project we use a debugger on the PC and when everything works, we only send it to the display. You can see inbound and outbound data in the debugger.
  • #76 17588027
    Anonymous
    Level 1  
  • #77 17588534
    sq9cyg
    Level 11  
    Then write why?
    I am a great beginner so every remark is appreciated.
  • #78 17589354
    Anonymous
    Level 1  
  • #79 17589637
    ekrzychoooo
    Level 17  
    1. I do ctrl-F here on the page and type in temp8E and there is a definition in statement # 61.
    2. Even if the ID is bad, the setText function works after objName. Which doesn't mean the code can be messy.
  • #80 17591504
    Anonymous
    Level 1  
  • #81 17619718
    kaino
    Level 12  
    I have a question, how to call a given page from arduino in nextion?

    i.e. how does it exceed the dc temperature to display pages s1
  • #82 17619734
    Anonymous
    Level 1  
  • #83 17619745
    kaino
    Level 12  
    Jarzabek666 wrote:
    0x66 Current Page Number 0x66 0x01 0xFF 0xFF 0xFF
    Returned when the sendme command is used.
    0x01 is current page number
    data: page 1


    NIe bardzo mi to cos mówi :)
  • #84 17619753
    Anonymous
    Level 1  
  • #85 17619788
    kaino
    Level 12  
    Jarzabek666 wrote:
    Well, I can't help you that you do not know the basic instructions of the display, this function works both ways, i.e. it sends ardunio which page is loaded and ardunio can send which page to load.

    Please see this https://nextion.itead.cc/resources/documents/instruction-set/


    sendCommand ("0x66 0X02 0XFF 0XFF 0XFF");

    side id is 2

    and its not working
  • #86 17619808
    Slawek K.
    Level 35  
    Send the command using sencommand: page page_num, ie eg senCommand ("page 1");

    Greetings
  • #87 17619809
    kaino
    Level 12  
    rs6000 wrote:
    Send using sencommand the command: page page_num, that is for example "page 1"

    Greetings


    I have already done so

    myNextion.sendCommand ("page 0");

    but it doesn't work
  • #88 17619813
    Slawek K.
    Level 35  
    It must work, you may have a bug in the conditional statement, call it in eg setup and check it.

    Possr

    Added after 59 [minutes]:

    Try again like this:

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

    assuming the iD of the page you want to call is 2.

    Greetings
  • ADVERTISEMENT
  • #89 17624539
    moeneo
    Level 2  
    Hello. thanks the author for extensive tutorials.
  • #90 17673885
    sq9cyg
    Level 11  
    Has anyone managed to solve my problem?

Topic summary

A new video tutorial series for NEXTION displays is being developed, focusing on various functionalities and programming techniques. Users discuss the capabilities of NEXTION displays, including sending commands, managing timers, and handling multiple pages. Key topics include using buttons to control outputs, sending data from Arduino to NEXTION, and managing display states across different pages. Users share code snippets for specific tasks, such as updating text fields based on variable values and implementing timers. There are also discussions about troubleshooting issues related to memory usage on Arduino, interfacing with GPS modules, and optimizing communication between Arduino and NEXTION displays.
Summary generated by the language model.
ADVERTISEMENT