#98 Nextion Display - Dual State button connected to Arduino - Nextion Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 49

  • @search4truth616
    @search4truth616 4 ปีที่แล้ว +1

    These demonstrations of practical applications really are helpful. Thanks.

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว +1

      Thanks for your continued support. I am still looking into those links you posted. I am reworking the main website first and switcing over my Patreon so if I follow your advice I will be ready to go.

    • @Neomight
      @Neomight ปีที่แล้ว

      Need this code for my project

  • @3xAudio
    @3xAudio 4 ปีที่แล้ว +2

    Always interesting ideas to get inspiration in the Arduino community thanks for sharing.

  • @almagnejandelarmente6957
    @almagnejandelarmente6957 ปีที่แล้ว +1

    Greetings! Thankyou for this wonderful tutorial of yours. I have a question, though. I have a project set up like this: a relay controlled by a nextion display containing two pages, the first one is for the logo and the second is for the buttons. For the buttons, I use a dual-state-butons to control the status of the relay so when you click the button, the status of the relay triggers ON and persists until I click the button again. My problem is that when I go back to the first page containing the logo while a button is clicked on the second page, the status of the button in the second page resets while my relay continues to be ON. So it seems the use of dual state buttons is compromised. Do you know what should i do to to fix my problem? Thank you for your insight.

    • @CheapControls
      @CheapControls  ปีที่แล้ว

      You need change the scope from local to global. You should see this in the attributes of the dual state button. thank you for the kind words and good luck with your project.

  • @rockrock4478
    @rockrock4478 ปีที่แล้ว +1

    Hi.Can I get the sketch Arduino of that video? THANKS!

    • @CheapControls
      @CheapControls  ปีที่แล้ว

      You have to make file request at www.cheapcontrols.com on the help page

  • @DianaMartinez-su6jh
    @DianaMartinez-su6jh ปีที่แล้ว +1

    This is such a great tutorial! Im having touble finding the files for download. I found the video in the old website, but there are no links for downoading files, am I looking for them in the wrong place?

    • @CheapControls
      @CheapControls  ปีที่แล้ว +1

      That is an older video. I don't have all the files for every video loaded. But I will load them as people request. I just uploaded the files. the should be available now. I could not remember which Arduino file I used in the video. I have two uploaded. I hope one will work for you. If not let me know and I will try to figure out how to help better. thank you for your kind words.

    • @DianaMartinez-su6jh
      @DianaMartinez-su6jh ปีที่แล้ว

      @@CheapControls you are so kind! thanks a lot!!!

  • @heinrichdutoit695
    @heinrichdutoit695 ปีที่แล้ว

    Hi. great work with all the videos!
    Hope you can help... I am trying really hard to find a video to see 2 dual-state buttons turning on 2 separate LEDs. This is all I will need in my project for now, but I can't find how to do this. I find many videos of how to use a dual-state button to turn on 1 LED, but nowhere about multiple dual-state buttons... Please help....

    • @CheapControls
      @CheapControls  ปีที่แล้ว

      See if this video helps th-cam.com/video/IsRS8MRLBgQ/w-d-xo.html. If you want a code review consider connecting to me over on www.cheapcontrols.com on the help page.

  • @plaketal1752
    @plaketal1752 4 ปีที่แล้ว +1

    hi,
    I want to trigger Nextion button from arduino, not per hand on the display. do you know, how to trigger dual button from arduino to Nextion display.

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว

      See if this video helps th-cam.com/video/zExP3QpUQEo/w-d-xo.html. Thanks for watching

  • @agib531
    @agib531 2 ปีที่แล้ว +1

    Hi, sorry if I persist with the questions but I can't understand, if I only have a "dual state button" how can I send the two states separately to arduino to make him do a different action for each state?
    I have performed many tests but I cannot understand how to do it.
    I'm a tough head :-)

    • @agib531
      @agib531 2 ปีที่แล้ว

      Ok, I found the solution, I don't know if it's right or it can be done better but it works, just add these lines in Nextion Editor to send the two different states:
      if(bt1.val==1)
      {
      print "vaporeON"
      }else if(bt1.val==0)
      {
      print "vaporeOFF"
      }

    • @CheapControls
      @CheapControls  2 ปีที่แล้ว +1

      That is the way I would do it. Very Good

    • @DianaMartinez-su6jh
      @DianaMartinez-su6jh ปีที่แล้ว

      @@CheapControls As I uderstand, the difference in the case above you can program whatever you want inside the if and that will be done on the nextion side before sending something to the arduino, and in the case on the video the nextion sends a 0 or a 1 when the button is pressed and then you can program whatever you want to do with that on the arduino side, right? Sorry for the many questions, Im just beggining to understand how this works

    • @CheapControls
      @CheapControls  ปีที่แล้ว +1

      @@DianaMartinez-su6jh That logic is correct. but I would not just send a 0 or 1. I send it in a key-value pair with a beginning and end parameter. like C:CTST0? starting parameter C:C then the command being TST then the value of 0 then the ending delimiter of ?

  • @Neomight
    @Neomight ปีที่แล้ว +1

    How I can get the code from this project ?

    • @CheapControls
      @CheapControls  ปีที่แล้ว

      You have to submit a comment/question over at www.cheapcontrols.com on the help page.

  • @daryl7237
    @daryl7237 4 ปีที่แล้ว +1

    hi there I copy and paste the code_5 from the text file to Arduino, and verify it show this message (error: 'Serial2' was not declared in this scope) I don't know what I have missed! Can you please help me?

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว +1

      What model of Arduino are you using?

    • @daryl7237
      @daryl7237 4 ปีที่แล้ว +2

      Cheap Controls I’m currently using Arduino uno

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว +1

      My videos use a mega. you will need to add a library and alter the code a bit for the UNO. The mega has extra built in serial ports that the UNO does not have. It is not difficult to use with an UNO. I will post a second reply here with the library. I will also post an different file for the UNO. I am not on my development laptop but will be later.

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว +1

      @@daryl7237 I have the code up at Cheap Controls for download(The links look identical but if you hover over them you will see one will say UNO in the file name). I will work on creating a separate image for UNO versus MEGA. You will notice two new lines at the top of the code. This is for the softserial library. Then in the code Serial2 is replaced with mySerial. You will use pins 2 and 3 for the additional Serial Port.

    • @daryl7237
      @daryl7237 4 ปีที่แล้ว +1

      @@CheapControls woo! that's great thank you so much!

  • @dashasaldivarfavela1c540
    @dashasaldivarfavela1c540 4 ปีที่แล้ว

    hi, do you have one example only one button, please.

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว

      A single button on the arduino sent to Nextion or a single button on Nextion sent to Arduino?

  • @kamilzdunczyk2245
    @kamilzdunczyk2245 4 ปีที่แล้ว

    what the code should look like if I would like to control the LEDs with buttons. without flashing, only send data from nextion to Arduino - enable or disable with the button
    and by the way, can't download files from the site

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว +1

      I am rebuilding the site. You are the second person to ask about downloading the files. I did not think people were going to the site for the files. I will add a link to the old site on the new one and fix the links in the youtube videos. I appreciate you point it out. I am not sure what you mean by flashing. Do you want a on/off button on the nextion to control and LED on the Arduino? I just want to be clear on your question.

    • @kamilzdunczyk2245
      @kamilzdunczyk2245 4 ปีที่แล้ว

      @@CheapControls thank you
      yes, I just want dualstatebutton to turn on or off the diode connected to arduino

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว +1

      I have a link to the old site on the new site. You should be able to download the files from the old site.

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว +1

      Try this video and see if it helps. th-cam.com/video/LL4TduSYsZ8/w-d-xo.html

  • @TheWindtalker2011
    @TheWindtalker2011 4 ปีที่แล้ว

    hi can make vdo control 6 relay channel using HMI nextion 7" display with arduino mega.?. thnx in advance and i like your vdo tutorials just learning...

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว

      I don't have a 6 channel relay. I will be making a video with a single relay. Maybe that will be enough to help you. I am not sure when I will make but hopefully soon. I will try.

  • @thienle2429
    @thienle2429 4 ปีที่แล้ว

    Heelo . You can sending data HMI TJC with arduino mega please. Example led on , off please . Sorry I study English very Bad. Sorry

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว

      I am not sure what you mean by TJC?

    • @CheapControls
      @CheapControls  4 ปีที่แล้ว

      I noticed you joined the private Facebook group feel free to ask the same question in that group.

  • @jittaweemetesirorat7577
    @jittaweemetesirorat7577 ปีที่แล้ว +1

    cov bt0.val,va0.txt,1
    va0.txt=+"bt0"
    print va0.txt
    Error:Invalid Variables:va0txt( Double click to jump to code)
    Error:Invalid Variables:va0.txt( Double click to jump to code)
    Error:Invalid Variables:va0.txt( Double click to jump to code)
    Error:Compile failed! 3 Errors, 0 Warnings,
    Where did I go wrong?

    • @CheapControls
      @CheapControls  ปีที่แล้ว +1

      I am not sure I don't have my dev system with me. I know cov is still usable but you should use covx. I think va0.txt=+ should be vao.txt+= instead and print needs to be in () prints(va0.txt,0) or something like that

    • @jittaweemetesirorat7577
      @jittaweemetesirorat7577 ปีที่แล้ว

      @@CheapControls I tried to watch the video many times but still error
      Video 6:50
      cov bt0.val,va0.txt, 1
      va0.txt+="bt0"
      printva0.txt
      Error:Invalid Variables:cov bt0.val ,va0.txt, 1( Double click to jump to code)
      Error:Invalid Variables:va0.txt( Double click to jump to code)
      Error:Invalid Variables:printva0.txt( Double click to jump to code)
      Error:Compile failed! 3 Errors, 0 Warnings,
      Do you have HMI File? thank you

    • @CheapControls
      @CheapControls  ปีที่แล้ว +1

      You are correct. I just looked up the old file. What version of the Nextion IDE are you using?

    • @jittaweemetesirorat7577
      @jittaweemetesirorat7577 ปีที่แล้ว

      @@CheapControls Nextion Editor ver 1.65.0

    • @jittaweemetesirorat7577
      @jittaweemetesirorat7577 ปีที่แล้ว

      @@CheapControls
      I want to make project switchbutton arduino & Nextion dual state press switchbutton arduino to show
      state at the Nextion screen.
      But I can't write code.
      Nextion Editor ver 1.65.0