Elektroda.com
Elektroda.com
X

Search our partners

Find the latest content on electronic components. Datasheets.com
Elektroda.com

Video tutorial displays NEXTION

ekrzychoooo 22467 237
This content has been translated » The original version can be found here
  • About Author
    ekrzychoooo
    Level 17  
    Offline 
    ekrzychoooo wrote 279 posts with rating 61, helped 24 times. Live in city Pszczyna. Been with us since 2010 year.
  • #2
    gulson
    System Administrator
    Write something more (what kind of display is it, what is good in it, what can be used for), because for now it looks like an advertisement for your channel :)
  • #3
    ekrzychoooo
    Level 17  
    The following parts have been released so far:







    TOPIC
    Arduino
    LCD
    INTRODUCTION
    BUTTON - 1
    BUTTON - 2
    TEXT - 1
    TEXT - 2
    System init
    NUMBER + TIMER NexTimer, recvRetNumber, NexTouch, attachPop number, timer, get, printh, if-else, font
    TIMER + MENU - BUTTON
    - TEXT
    - TIMER
    - operator if
    - zmienne systemowe SYS0, SYS1
    - array component b[id]
    NUMBER - biblioteka SODAQ_BMP085
    - setValue
    - NexTouch
    - obiekt NexNumber
    - pole number
    - pole text
    ZMIENNE SYSTEMOWE - getValue
    - setValue
    - setText
    - sendCommand
    - recvRetNumber
    - obiekt NexVariable
    - NexText object
    - DP system variable
    - NUMBER field
    - TEXT field
    - get command
    - page command
    SYSTEM VARIABLES DIM - system variable dim
    - timer
    - NUMBER element
    SLIDER - NexNumber
    - NexSlider
    - gestureValue ()
    - setValue ()
    - atachPop ()
    - SLIDER item
    - NUMBER element
    - send event
    PROGRESS BAR -NexProgressBar
    - setValue ()
    - progress bar
    - timer
    - numeric field
    - error codes
    CROP
    HOTSPOT - HOTSPOT
    - picq
    - tsw
    - xp
    - number
    PICTURE - PICTURE
    - TIMER
    - SYS VARIABLES
    - BUTTON
    - VIS
    GLOBAL VS LOCAL - nexNumber
    - getValue
    - setValue
    - NUMBER
    - BUTTON
    - VSCOPE GLOBAL LOCAL
    FLOAT ds18b20 - nexText
    - setText
    - getText
    - memset
    - toCharArray
    - float to String
    - toFloat
    - DS18b20
    - DallasTemperature
    - NUMBER
    - TEXT
    - PICTURE
    FLOAT b - user variables
    - cov
    - number
    - button
    - text
    SLEEP - sendCommand - sleep
    - ussp
    - thsp
    - thup
    - dim
    - keyboard
    - number
    - text
    - button
    GOSUB DROP-DOWN MENU (live)
    TAB MENU
    PYTANIA ODPOWIEDZI MEMORY SIZE #23 (live) Apetyt na ram obiektów nextion
    Protect Page #24 - page
    - click
    - vis
    - timer
    - variable
    - button element
    - txt element
    - numeric keyboard
    PYTANIA ODPOWIEDZI #25 (live) - dsbutton
    - debuger
    WAVEFORM LIS3MDL #26 - waveform - nexwaveform
  • #4
    kaino
    Level 12  
    Hello, I have a question, how to send commands with one button to activate several dual state buttons at once?

    and will the arduino read that the state is low for, for example, several relays?
  • #5
    ekrzychoooo
    Level 17  
    Hello
    One command is unlikely to succeed. There is a trick that can be used:
    create a Hotspot, e.g. m0 with the size of 2x2px and the code in it
    Code:
    bt0.val=1
    
    bt1.val=1
    bt2.val=1
    bt2.val=1

    And with arduino send a click code to click m0.0
    In the film Link I showed how to use Hotspot in an unusual way
    Quote:
    how to send commands with one button
    I do not know exactly whether it is for LCD or arduino with LCD.
  • #6
    kaino
    Level 12  
    Thank you for the answers, is it possible to call such a function by entering the page, e.g. page 1

    Already translators, I would like the display to start with some informational page (welcome page)

    and after going to the next page it automatically turned on two relays, but that they were all the time high until the knock, I will not turn off the power
  • #7
    Slawek K.
    Level 34  
    Very good guides, I use these displays in my projects and I have used these guides several times.

    Greetings
    Slawek
  • #8
    ekrzychoooo
    Level 17  
    kaino wrote:
    Thank you for the answers, is it possible to call such a function by entering the page, e.g. page 1

    Already translators, I would like the display to start with some informational page (welcome page)

    and after going to the next page it automatically turned on two relays, but that they were all the time high until the knock, I will not turn off the power


    On page0 in preinicjalize event
    Code:
    page 4

    on page 4 (welcome), display the greeting and add a timer. Set the timer for a few seconds

    In timer events:
    Code:
    printh 65 04 02 00 ff ff ff
    
    page 0


    printh 65 04 02 00 ff ff ff is like pressing an element with index 02.
    In arduino, this should be intercepted with a function, e.g. callback, and the relays should be switched on there. I showed this in video # 7.
  • #9
    kaino
    Level 12  
    hello, nice if you add sketches for arduino to the video tutorials.

    I have a question, do you have an idea how to wirelessly connect nextion with arduino?
  • #11
    ekrzychoooo
    Level 17  
    kaino wrote:
    hello, nice if you add sketches for arduino to the video tutorials.

    It's been like that since the episode # 21
  • #12
    kaino
    Level 12  
    rs6000 wrote:
    Via Bluetooth.

    Greetings


    Do you have a checked receiver and transducer?
  • #13
    Slawek K.
    Level 34  
    For example, HC-05, HC-06, I use these, but others are available.

    Greetings
  • #14
    kaino
    Level 12  
    rs6000 wrote:
    For example, HC-05, HC-06, I use these, but others are available.

    Greetings


    I just need to pair them and they will communicate?
  • #15
    kaino
    Level 12  
    ekrzychoooo wrote:
    Hello
    One command is unlikely to succeed. There is a trick that can be used:
    create a Hotspot, e.g. m0 with the size of 2x2px and the code in it
    Code:
    bt0.val=1
    
    bt1.val=1
    bt2.val=1
    bt2.val=1

    And with arduino send a click code to click m0.0
    In the film Link I showed how to use Hotspot in an unusual way
    Quote:
    how to send commands with one button
    I do not know exactly whether it is for LCD or arduino with LCD.



    After typing click m2.1 at the top of the page, it does not start these relays, but when I type in the debugger from my finger, it works, what I'm doing wrong
  • #17
    kaino
    Level 12  
    ekrzychoooo wrote:
    It's hard to say something without seeing the code.
    Can you paste the HMI file here as an attachment to a post?

    Added after 14 [minutes]:

    There is a new episode.
    How to protect access to the site with a password


    I watched the latest episode and it became clear :)

    You will not click on another page

    Now I am struggling to add 3 physical buttons to match the dual state button in the nextion

    I try to do it with little success


    Code: c
    Log in, to see the code
  • #18
    ekrzychoooo
    Level 17  
    Is there a pin 213 in your arduino
    Quote:
    pinMode (213, OUTPUT);


    bt0.val can be either 0 or 1 and you are constantly subtracting 1
    Quote:
    sendCommand ("bt0.val- = 1");


    or keep adding 1
    Quote:
    sendCommand ("bt0.val + = 1");


    You have S1 as input and you set it as if it were an output:
    Quote:
    if (dual_state) {digitalWrite (S1, LOW);} else {digitalWrite (S1, HIGH);}
  • #19
    kaino
    Level 12  
    ekrzychoooo wrote:


    You have S1 as input and you set it as if it were an output:
    Quote:
    if (dual_state) {digitalWrite (S1, LOW);} else {digitalWrite (S1, HIGH);}


    can you tell me how it should be set?
  • #20
    ekrzychoooo
    Level 17  
    w setup
    Code: c
    Log in, to see the code
  • #21
    kaino
    Level 12  
    I have arduino connected to usb pc and in debug mode I select user mcu input

    I can see that the arduino gets the command after the LEDs, but the LED on pin 13 does not go out

    Code: c
    Log in, to see the code
  • #22
    ekrzychoooo
    Level 17  
    you have the bt0PopCallback function implemented at the end of the code and you use it in setup.
    Make a declaration of this function before setup

    Code: c
    Log in, to see the code
  • #23
    kaino
    Level 12  
    ekrzychoooo wrote:
    you have the bt0PopCallback function implemented at the end of the code and you use it in setup.
    Make a declaration of this function before setup

    Code: c
    Log in, to see the code


    cramps still not working

    https://github.com/itead/ITEADLIB_Arduino_Nextion

    hardware download libraries are arduino mega
  • #24
    ekrzychoooo
    Level 17  
    In fact, it has no right to work.

    analyze this passage

    Code: c
    Log in, to see the code


    button_pin3 is probably always on HIGH, so you have bt0.val permanently on 0

    try this code
    Code: c
    Log in, to see the code
  • #25
    kaino
    Level 12  
    ekrzychoooo wrote:
    In fact, it has no right to work.

    analyze this passage

    Code: c
    Log in, to see the code


    button_pin3 is probably always on HIGH, so you have bt0.val permanently on 0

    try this code
    Code: c
    Log in, to see the code


    thank you for your willingness to help but I think I have to write it again because it still does not work :)
  • #26
    ekrzychoooo
    Level 17  
    In the display for the bt0 button in the "Touch release Event" "Send command ID" must be selected.
    If you have it, I don't know what could be either.
  • #27
    kaino
    Level 12  
    ekrzychoooo wrote:
    In the display for the bt0 button in the "Touch release Event" "Send command ID" must be selected.
    If you have it, I don't know what could be either.


    I coped with it, but when I press the physical button, the icon on the display changes like bt0 = 1 but it does not perform the tasks it has assigned, I had to add it to the execution. But then I can't control the display with a button :)


    Code: c
    Log in, to see the code
  • #28
    ekrzychoooo
    Level 17  
    kaino wrote:
    sendCommand ("s2.bt0.en = 1");
    sendCommand ("s2.bt1.en = 1");

    kaino wrote:
    sendCommand ("s2.bt0.en = 0");
    sendCommand ("s2.bt1.en = 0");


    What are these bt0 and bt1 elements?

    Whether bt0 and bt1 definitely have an attribute en
    Attach the HMI file to the post
  • #29
    kaino
    Level 12  
    ekrzychoooo wrote:
    kaino wrote:
    sendCommand ("s2.bt0.en = 1");
    sendCommand ("s2.bt1.en = 1");

    kaino wrote:
    sendCommand ("s2.bt0.en = 0");
    sendCommand ("s2.bt1.en = 0");


    What are these bt0 and bt1 elements?

    Whether bt0 and bt1 definitely have an attribute en
    Attach the HMI file to the post


    What are these bt0 and bt1 elements?

    then I am sending the state to dual state buton that are 0 or 1

    Ps I installed eclipse how to set it to prompt the commands like you in the movie :)
  • #30
    ekrzychoooo
    Level 17  
    - I think it should be s2.bt0.val and not s2.bt0.en
    - Eclipse Window -> preferences -> C / C ++ -> Indexer -> Enable indexer