59 Program a button on the

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

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

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

    Thank you for awesome tutorials, i made my 1st real project with your help, God bless you, all the best. The way you share and teach is what i like most. Never had a teacher like you in engineering class.

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

    God bless you! After a week of fiddling and breaking the head with Nextion simple buttons, I found your video!!

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

      I am glad it helped I have a new version of the video. #174 As I play with the display I keep altering how I use it. Thank you for taking the time to comment.

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

    Thanks for making this video. This really helped! It especially made a lot of sense to me as my first job programming was actually as a Audio Visual control system engineer over 20 years ago. I used to control kramer switches and projectors too!

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

      That is interesting. I have left that industry a few months ago and miss that part of it. I originally hoped this channel would be about controlling Audio Video products. I am in the process of transitioning it to more general control and measurement. I know build testers for products that come off assembly lines. Thanks for watching.

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

    Thank you for this quick and straight forward explanation! I started using my Nextion with their libraries and lost 50% of controller memory to service 3 pages of the display, need to re-write without it to get some space back.

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

      Good luck. Let me know if it works out for you. My methods are not for everyone.

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

    Your videos have been very helpful. I am a 52 year old noob and I have gotten this display to do everything I want with the IDE thanks to you and other youtubers.
    If you ever get bored enough to do a tutorial on the 2x5 header gpio expansion board or the button board you will be my hero.
    Thanks

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

      Sorry but I have not worked with the intelligent displays. I did look up the boards you mentioned and it has me thinking about them.

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

      This is where you've helped me get to. Thanks again! Having so much fun with this project. Have become an ecstatic hermit the last few days which is good because its cold outside. th-cam.com/video/LT_txsPWYAE/w-d-xo.html
      The GPIO header expansion works with the Enhanced. I haven't messed with the intelligent displays either. I gave up on it for this project. Things like this derail me until I figure it out or shelve it and I wasn't figuring it out. 8 Digital pins, of which 4 are PWM just wasted for the time being.
      I wish Nextion would have at least released a demo HMI showing utilization of the pins for different things but I can't find anything like it. Same goes for their button/beeper expansion board.
      Thanks again for all your videos. The front end (display) is just about done and the back end(Mega) is under way. A whole lot faster thanks to these videos.
      Cheers!

  • @NoThanks-t3p
    @NoThanks-t3p 8 หลายเดือนก่อน

    This was INCREDIBLY helpful! I was able to get a 12v DC motor working with my L298N motor driver/Arduino because of this video! It’s so cool. THANK YOU 😊

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

    Thank you! This makes much more sense!

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

      Glad it helped and thanks for the nice comment.

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

    Thank you for posting this series! Job well done sir

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

      Thank you for the kind words. I hope you find them all helpful

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

    Ty for this great series, God bless you !

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

      Thanks for watching and may god also bless you and all those you happen to meet. I appreciate the continued support.

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

    Excellent! Bravo and thanks. More please !

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

      You are welcome. I try to publish weekly.

  • @Rebel-from-Hell
    @Rebel-from-Hell ปีที่แล้ว

    easy to follow and understand, thank you

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

    Hi, many thanks, your videos are simple and effective. I would go not for the library too, because i like not to learn different methods but i prefer to keep things standard. But how would you send a data e.g. a slider val, from the screen to the arduino without lib? Thanks
    Subscribed.

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

      th-cam.com/video/k9hibCPbQ08/w-d-xo.html Check out this video. It might help. Thanks for watching

  • @grispaez3745
    @grispaez3745 10 หลายเดือนก่อน +1

    Son muy buenos sus tutoriales!! Muy bien explicados. Me podría ayudar con una duda por favor, tengo un botón en mi pantalla Nextion, requiero que al presionarlo se ejecute una interrupción en mi arduino DUE, que instrucción puedo usar??. En botones conectados fisicamente se usa la instruccion "attachInterrupt". En este caso cual instruccion debo usar?

    • @CheapControls
      @CheapControls  9 หลายเดือนก่อน +1

      Sorry for the late reply. This would depend on the model of Nextion you are using. You can request mor help at www.cheapcontrols.com.

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

    PRINT is deprecated and appears not to work in latest Nextion editor use prints "ON",2 to send string to aduino. In other words the first argument is the string you want to send the second is its length. Great work by the way really enjoy learning with you.

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

      I am rebuilding the main cheap controls website and will update all my code. I try to provide a link to all the HMI files and the Arduino code in the video. I have chosen to leave the code as is until I get the new site up and running. I will be displaying the code on the new site in a different way and at this time I have decided to focus on the new over the old. When I get the site up and running I will go back through this and other videos with an update. Thank you for watching and I appreciate the compliment. This particular video I may pull down and completely reshoot. It has a majority of my views and as time goes by I think there is a better way to explain some of it.

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

    Many thanks for this.

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

    Good job bro

  • @michaelreinhardt9435
    @michaelreinhardt9435 11 หลายเดือนก่อน +1

    Thanks for the great tutorials. However, I have difficulties querying the buttons and displaying the temperature of a sensor at the same time, for example. The buttons then no longer work. Is there a solution ?

    • @CheapControls
      @CheapControls  11 หลายเดือนก่อน

      I am not sure how to help in a comment. If you go to www.cheapcontrols.com, there is a help page. Go there and submit a comment with your email and I will do the best I can.

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

    Thanks for these tutorials which help a beginner like me a lot, I wanted to ask you if it is possible to use the "dual state button" without the library.
    Thank you.

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

      Thank you for watching - Check out this video th-cam.com/video/IsRS8MRLBgQ/w-d-xo.html

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

      @@CheapControls Thank you very much but I meant the "dual state button" present in the new releases of Nextion Editor, a single button with two states, I would like to understand how to distinguish the two states without the library.
      Sorry for my translator's English :-)

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

      The green and red buttons on that video are dual state buttons and I do not use the Nextion Library.

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

      @@CheapControls ahhhh, ok, I didn't watch the video carefully, I have to use subtitles to understand and I'm a super beginner, now I understand better, thank you so much for your patience :-)

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

      You are welcome. I struggle with many things so i try to be patient with others.

  • @Bravo_Ventures_LLC
    @Bravo_Ventures_LLC 4 วันที่ผ่านมา

    I wrote the same exact code as you. Only two functions though. "On" and "Off". I don't get any readings in my IDE serial monitor. Yes my baud rates match. I even tested my rx tx wires for continuity. I know rx tx are connected because like others I have to disconnect blue wire to be able to upload the code. Im getting ready to call this "intelligent" display defective and ask for a refund. Good thing I bought it on Amazon.
    Ok turns out the nextion display needs to be directly connected to the control board, speaking of vcc and ground, with a baud rate of 9600, 115200 wouldnt get me a reading. Now I get a reading. Now I have to reconnect everything to my control board to see if I can get anything to actually turn on
    I took a shortcut and just used the led_builtin pin 13. Yes it worked. This whole time. Ignoring my instinct to connect to the damn board directly. I mean I have 12VIN and an adapter for all my 5V components. My goodness. Thank you for the vids bro

    • @CheapControls
      @CheapControls  3 วันที่ผ่านมา

      I am glad it is working.

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

    i have a problem, every time I press the botom in the serial, appears a "?". which means nothing bcause I printed in a botom -> print "1" for example and the Serial.println("programa 1");

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

      Should it be Serial2.println ?

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

      @@CheapControls no :(

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

      @@CheapControls actually having the set up and the loop empty, I load the program. I press anywhere on the screen and a "?" appears in the serial.

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

      If you want you can email your code for review.

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

    Thanks for this Video ! - as I'm a beginner : is it possible to control an extrernal Relay Board (16 Channel) with the nextion GPIO Pins over the serial I2C Bus or do I have to use an Arduino for this

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

      I have not found a way to do I2C directly with the Nextion. I have controlled relays directly from the GPIO pins but not with any sort of protocol. Thank you for watching

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

    Thank you very much sir, it is great video

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

      Thank you for your kind comment.

  • @pravinpadale8787
    @pravinpadale8787 5 ปีที่แล้ว +3

    Hi, great tutorial !!!, Can you please also show, how Arduino can send back to display and that is shown on the touch display ? May be a bit complex interface like you send something from nextion display to arduino and then arduino talks back to show something on nextion display ?

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

      That is a great idea. I will start on it today and hope to have one or two published in the next day or two(My real job is always getting in the way :-). I will do one simply sending data on an interval then do a followup on sending data back upon a request from the Display. Thanks for the recommendation. I should have done these sooner.

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

      @@CheapControls great !!! Will be waiting for your next tutorial, request if you can show this for multi-page scenario, currently I am working for an assignment, will be a great help.

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

      @@pravinpadale8787 I added the video. I hope it is what you need. I plan a third and will try to work in a multi-page feature.

    • @pravinpadale8787
      @pravinpadale8787 5 ปีที่แล้ว

      @@CheapControls thank you very for your efforts, yes this is what I was looking for. It's great help. Looking forward for more videos from you in future.

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

      I posted a multipage tutorial. I will expand on the topic on my next video.

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

    How to add one or two more buttons to a sketch? Please.

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

      I have an updated video to this one th-cam.com/video/b9j7fX45qDo/w-d-xo.html - Let me know if it helps you.

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

    Great stuff. Can you help me design a four "Dual-state button" in Nextion display to activate four separate leds or relays on Arduino independent of each other.

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

      Do you mean in a video or would you like to have me write the code for you?

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

      @@CheapControls First of all thanks for your quick and kind attention. I would say make a video so it can help others like me. Thanks again.

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

      Thanks for the donation. I will try to get it up by the end of the week. I am currently editing a video I hope to release tomorrow or Tuesday that shows how to use the built-in input output on the Nextion.

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

      @@CheapControls My pleasure. Thanks a million.

  • @naveenvaid4318
    @naveenvaid4318 4 หลายเดือนก่อน

    thank you best nexation tutorials i want to five pages slidshow after one seconds what is the coding in nexation editor without arduino

    • @CheapControls
      @CheapControls  6 วันที่ผ่านมา

      Sorry this is so late. I had some personal issues and had to take some time away from TH-cam. Do you still need help? If so go to www.cheapcontrols.com and submit a comment. I will reply with an Email

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

    Hello,
    I am not able to receive any response from the HMI (usng mega). However when i tried printing text onto the HMI, it is working, button is not. What am i doing wrong?

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

      It is hard to say without seeing the code. Please consider going over to the Cheap Controls Facebook page. You can message me there and attach the HMI file for review.

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

    Is it possible to send "ON" on the press event and "OFF" on the release event. I would like to jog a stepper motor while pressed and stop when released.
    Thanks

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

      That is very possible but I would recommend sending a series of on requests while the button is pushed and then not sending when it is not pushed. In the event that the Arduino fails to receive the off it will stop if it does not see the an on request for a set period of time. You can use a timer that runs on the press event and stops on the release event. Or you could use a dual state button if you don't want to hold the button while the stepper is turning. The project sounds interesting. Good Luck and Thanks for watching.

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

    Hello can you share some sample codes for uploading datalog to Nextion lcd and saving to its SD card

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

      I have no examples of this sort of function at this time.

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

    I have small dought iam sending analog values (0-1024);resultion(0-255).the wave coming very very small,and try to adjust to zoom not happening,i tried to adjust all variable of attribute of waveform but no results

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

      watch this video and see if it helps th-cam.com/video/9yGZYoCRS7g/w-d-xo.html

  • @Deiski76
    @Deiski76 3 ปีที่แล้ว

    You are the best

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

      You are the best for watching my videos. I will have more this fall.

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

    i have a number in my Nextion which i can change with the integrated Keyboard. I want to send "wait" and the variable of the number when i exit the page. What should i write on the exit button?
    print "wait" + waitTime.val doesnt work :/

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

      You have to set up a couple variables as strings and then load them with the data and then concatenate them and finally print the variable. It is not straight forward but once you do it a couple times it comes naturally.
      variable va1 and va2 configured as a string
      va1.txt="wait"
      covx waitTime.val,va2.txt,0,0
      va1.txt+=va2.txt
      print va1.txt
      I have not tested this so there may be a typo but I hope the idea is clear. If not let me know and I will try to find a current video I have made that describes it better. If I don't have a video I will make one. Thank you for watching

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

      @@CheapControls wow, i havent got a notification from TH-cam that you answered my comment. Anyways thank you it seems to work now, except i have another combination which i want to send over.
      va0.txt="WAIT"
      covx waitTime.val,va1.txt,0,0
      va0.txt+=va1.txt
      print va0.txt
      delay=30
      va2.txt="DISTANCE"
      covx distance.val,va3.txt,0,0
      va2.txt+=va3.txt
      print va2.txt
      the delay is there to "divide both variables" (the delay creates a new line). but the problem is, the second number is limited to 2 digits. I can enter 1 number and it sends 1 number but if i enter more than 2 numbers the other numbers dont get sent to my esp32. The first number is not limited at all.

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

      @@CheapControls i figured it out. It was the "txt_maxl" which was at 10 so i raised it to 20 and now everything is working :)

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

      Glad you got it.

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

    nice tutorial...it is possible can use relay channel with arduino mega 2560?

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

    where can I dowload all command thank

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

      If you want the code you have to go to my website and ask for it in the comment section. I will email it to you.

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

    I have the exact same code as you do, but I cannot get it to read the data from the screen. All kinds of question marks and empty boxes show up and that's it

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

      Sorry to hear you are having issues. It might be the baud rate. Do you know how to connect the Arduino or MCU to the debug window. It makes it easer to simulate different strings and settings

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

      @@CheapControls No, I don't know how to do that.

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

      I can send data to the screen without any problems. I just can't read when a button is pushed.

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

      Just wanted to let you know i figured out how to do it with the Library. couldn't ever get your way to work. thank you though!

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

      There are lots of ways to do things. I have nothing against the Nextion library. If it works for you that is great. Please consider watching my videos on specific topics.

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

    Do you have a similar tutorial but for Double State Buttons?

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

      Try this one th-cam.com/video/IsRS8MRLBgQ/w-d-xo.html

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

      And thanks for taking time to comment and ask.

  • @imextradeco.6689
    @imextradeco.6689 4 ปีที่แล้ว +1

    Thank you for the very valuable video. I have a question. Communication between Nextion TFT and Arduino Uno3 has succeeded in my project, but data communication does not work on the ESP32 development board and ESP8266 development board. I am new to Arduino and Nextion TFT. If there is a website or video that is easy for beginners to solve these problems, would you please introduce it?

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

      I have wanted to do a video on the ESP series for awhile. I will look into it. I am not sure of any out there. Give me a week and I will try to get something together.

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

      I am working on a basic ESP8266 example. Did you have any aspects of what you are doing that I can add to my basic video that might help you?

    • @imextradeco.6689
      @imextradeco.6689 4 ปีที่แล้ว +1

      @@CheapControls I am very interested in videos that do not require the Nextion library you provided. What I want to do is very simple, but I am new to Arduino and programming. I am programming on an ESP32 Devkit or 8266 series. My stumbling block is to read the numerical data displayed in Nextion, such as n0.val, into the ESP32Devkit or 8266 side. On the Nextion side, I can get text data by doing something like (print "sometextdata") but I don't know how to handle numbers. For a shallow understanding, I refer to the sketches of many senior engineers, but it is difficult to understand because it is complicated. I deeply appreciate your kindness.

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

      I will try to work in an example using both text and numbers. I will also try to show transferring text and numbers both too and from the Nextion. This might end up being a two part video but I will do the best I can.

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

      OH, I learned something this past week. I did not know the ESP had that secondary serial transmit pin. It is funny how you can use something for awhile but completely overlook something. Not really important but I found it interesting.

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

    Do you know how to get the Nextion to work on the Arduino Nano 33 IoT? For some reason the same code that works on a regular Arduino Nano won’t work for an Arduino Nano 33 IoT.

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

      Are you using Serial or Serial1. I don't have once of those so I can't test but I believe there is a second serial port on the device.

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

      Cheap Controls are you referring to Serial in the config file?

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

      In the Arduino Code. Serial1.begin(9600) Pins d0 and d1. I am guessing on the pins but I could look it up if this does not make sense. Serial is on all Arduino devices. The Mega has Serial, Serial1, Serial2 and Serial 3. I believe the Nano 33 ioT has Serial and Serial1. I could be wrong about that. Also does the device run on 3.3 volts or 5. 3.3 volts could be your issue also. I am a little out of my depth not having worked with this device and I want to order one so badly but I have too many current projects to finish up that it will have to wait. I hope this was helpful.

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

      Cheap Controls It uses serial. I’ll try serial1 and hope it works. The device runs on 3.3 Volts, however I soldered the connection that also allows me to attach a 5V device to it. The error I’m getting comes from when I try to compile the code. It compiles perfectly for a regular Nano, however for the IoT Nano I get an exit status 1 error that says it can’t compile for some reason. Also, upon further inspection the error says softwareSerial only supports 20,16, and 8MHz processors. Do you suggest a workaround for this?

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

      @@goldenfang57 If there is a serial1 then you should not use softwareserial

  • @solomon-s7j
    @solomon-s7j 3 ปีที่แล้ว

    Hello, I try to design an interface that allow me to have hidden and visible( if I want) keyboard to register any name on textbox easily, but I cant !!!!! could you help me please???

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

      Something like this video? th-cam.com/video/XSSVtR4-ceU/w-d-xo.html

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

    Many thanks you...im trying to send several values to Arduino to control steper motor i used several values for example if i send A the stepper will move in speed and direction constant and if i send B it will move in different direction and speed its work but when loop finish the motor stop and wait another serial read how to keep same serial read value to keep in loop until i send different value?

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

      I can't be sure without seeing your code. My guess is there is a default that get changed when you go through the loop the second time. If you have the ability, please post your code on the cheap controls Facebook page.

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

      Thank you for replying im waiting the approval to join your group in Facebook i can post the example of my code here:
      #define dirPin 2
      #define stepPin 3
      #define stepsPerRevolution 200
      String data_from_display;
      void setup() {
      // put your setup code here, to run once:
      Serial.begin(9600);
      Serial.println("HELOO WORLD");
      pinMode(stepPin, OUTPUT);
      pinMode(dirPin, OUTPUT);
      }
      void loop() {
      if(Serial.available())
      delay(30);
      data_from_display = Serial.read();{

      if(data_from_display == 66){
      digitalWrite(dirPin, HIGH);
      // Spin the stepper motor 1 revolution slowly:
      for (int i = 0; i < stepsPerRevolution; i++) {
      // These four lines result in 1 step:
      digitalWrite(stepPin, HIGH);
      delayMicroseconds(2000);
      digitalWrite(stepPin, LOW);
      delayMicroseconds(2000);
      }
      delay(1000);
      // Set the spinning direction counterclockwise:
      digitalWrite(dirPin, LOW);
      // Spin the stepper motor 1 revolution quickly:
      for (int i = 0; i < stepsPerRevolution; i++) {
      // These four lines result in 1 step:
      digitalWrite(stepPin, HIGH);
      delayMicroseconds(1000);
      digitalWrite(stepPin, LOW);
      delayMicroseconds(1000);
      }
      delay(1000);
      // Set the spinning direction clockwise:
      digitalWrite(dirPin, HIGH);
      // Spin the stepper motor 5 revolutions fast:
      for (int i = 0; i < 5 * stepsPerRevolution; i++) {
      // These four lines result in 1 step:
      digitalWrite(stepPin, HIGH);
      delayMicroseconds(500);
      digitalWrite(stepPin, LOW);
      delayMicroseconds(500);
      }
      delay(1000);
      // Set the spinning direction counterclockwise:
      digitalWrite(dirPin, LOW);
      // Spin the stepper motor 5 revolutions fast:
      for (int i = 0; i < 5 * stepsPerRevolution; i++) {
      // These four lines result in 1 step:
      digitalWrite(stepPin, HIGH);
      delayMicroseconds(500);
      digitalWrite(stepPin, LOW);
      delayMicroseconds(500);
      }
      delay(1000);
      }
      }
      }

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

      Did you cut and paste the code. There are some curly brace errors and I am wondering if you typed it in it may be typos but if you cut and paste then I see some errors. I have accepted your facebook request. We can move over there. I am off to run some errands but will check in later.

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

    How did you use the Arduino UNO serial port to send data to/from the Nextion ?
    How do you upload Nextion file to the Nextion and yet talk to Nextion with Arduino?

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

      I am not sure I am understanding your first question. If you are asking about multiple serial ports check out this video. th-cam.com/video/O0uDENcBZP8/w-d-xo.html If you are asking about using the built in Serial Port I run the transmit from the Arduino to the Receive of the Nextion and the Transmit of the Nextion to the Receive of the Arduino. When I am in development I have wires running to a USB to Serial device and I switch the wires between the USB device and Arduino as required.

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

      @@CheapControls The UNO has one hardware serial port and you connect the Nextion to that hardware port, even though it has USB serial also "coming in" ? Perhaps because there are series 1k resistors on TX/RX ?

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

      I know that I have to be careful when I program the UNO and have the Nextion using the same single serial port. When I have it connected to my computer and am in the process of uploading new code I disconnect the Nextion and then reconnect after I the code is uploaded the UNO . You can use Software Serial to add a second Serial port to the UNO.

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

    hello there i have a quition please i am using your methode of codin nextion without biblio it's really helpfull its for my last year study project but the problem is i am using meanwhile an SD card to save the data for a long duration they're both on baud 9600 its arduino uno so i have only one serial can you give me an idea of what i can do
    thanks

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

      You can add a soft serial port. I have a video on the topic th-cam.com/video/O0uDENcBZP8/w-d-xo.html

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

    Video is great and easy to follow, so why can't my Nextion and Arduino follow same simple process. (always the way!!)
    Loaded nex file to display but cannot get Arduino to talk to it. Loaded Arduino code without blue
    nextion pin attached. Serial monitor won't even load hello world in setup. Help if poss would be very grateful. Else I will trial and error even deeper
    using Arduino uno and nx4827T043. visual display from TFT file via cd card to Nextion.

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

      You can contact me through Email or contact through www.cheapcontrols.com and send me the files to review. Thanks for watching.

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

    Hi,I wonder if you can give me a hand with this exact code an example.I have problem receiving on the serial monitor two response from Nextion
    example:
    void sendData(String data){
    if(data == "A");{
    Serial.println("Relay 1 ON");
    }
    if(data == "B");{
    Serial.println("Relay 1 OFF");
    }
    response :
    A // button 1
    Relay 1 ON
    Relay 1 OFF
    B //button 2
    Relay 1 ON
    Relay 1 OFF
    This happens for one push of a button
    I have 7 inch nextion enhanced display with 8 buttons,each one different print command.
    On the nextion everything seems to be fine sending but when connected to arduino mega 2560 the response on the serial monitor for each push button gives me On&OFF
    Thank you from now on you have another subscriber

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

      I am not sure. You would have to request help over at www.cheapcontrols.com. I will reply with an email address to submit your code.

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

    Hi can somebody please help..
    I have been using a nextion display NX 8048K070_011... I have just come to switch it on and all I get is the white display! Using a steady 5v , tried re upload of file but nothing works...it was fine last time I was using it. At a total loss..
    Please help!

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

      I am sorry but when I have issues with the hardware from Nextion I generally throw it away and get a new one.

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

      @@CheapControls thank you, that is what I intended to do.

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

      It is not an easy thing to do. I wish their tech support was better.

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

      @@CheapControls their tech support is terrible, rude even.

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

      I agree. It is a good thing their products are cheap. I asked if they would help promote my youtube channel and the said no. I feel like I am doing a good job showing their product. But I am not doing it for anything but me so I don't really care.

  • @vincent8368
    @vincent8368 3 ปีที่แล้ว

    Hi Cheap Controls,
    I hope you are doing well. I've seen that you answer practiclly all comments, even though it has been a year. So I thought that you would answer to this one too.Pl
    My nextion display (2.8 inch enhanced), arrived a week ago. I have been able to import tft files on it using my sd card, however I have NEVER managed to upload the nextion code, from the nextion editor, on my nextion from the nextion editor. While the arduino uno I used is recognised as COM3 (the port), it starts the baud rate thingy normally, but after 9 seconds or so, it writes the following error message: "Connection failed, forced interrupt. I have tried every single combination for the yellow and blue cable to tx and rx of my arduino.. nothing works. I have searched on all the forums the solution, but never came across it.... this I why I am adressing this to you, as you seem to know your stuff about the nextion more than well. I also have an other problem with the nextion editor... I have an arduino mega and nano (clones, but doesn't matter as recognised by arduino ide) and neither of them are recognised in the upload section of the nextion editor. They are not found.
    My nextion however seems to work when I connect it to arduino and put code in the ide the standard way. But this only suceeded once, and that was today, uploading a gauges tutorial on it. With your tutorial, I have tried every single combination blue and yellow wire. Even the ones where non of them are connected. Nothing happens. It just keeps my old project going. What is your configuration?? (I have seen previous comments, tried the ones in them but no success. Please come back to me, and if you find the solution, you would literally be a lifesaver. Also note that I am on mac, so I use the ide on my macBookPro, however I am using a virtual machine (Parralels Desktop) to run the nextion editor (setup works fine). I really do not know how this could interfere with my problem, but please investigate🙏🏻🙏🏻🙏🏻.
    Many thanks,
    Vincent

    • @vincent8368
      @vincent8368 3 ปีที่แล้ว

      /*
      The following sketch is an example of how to send data to the Nextion display without any library.
      The data can be text, numbers, or any other atribute of an object.
      You can also send System Variables to change settings on the display like: brightness, serial baud rate, etc.
      Connection with Arduino Uno/Nano:
      * +5V = 5V
      * TX = none
      * RX = pin 1 (TX)
      * GND = GND
      This sketch was made for my 1st video tutorial shown here: th-cam.com/video/wIWxSLVAAQE/w-d-xo.html
      Made by InterlinkKnight
      Last update: 02/04/2018
      */
      int variable1 = 0; // This is a simple variable to keep increasing a number to have something dynamic to show on the display.
      void setup() { // Put your setup code here, to run once:
      Serial.begin(9600); // Start serial comunication at baud=9600. For Arduino mega you would have to add a
      // number (example: "Serial1.begin(9600);").
      // If you use an Arduino mega, you have to also edit everything on this sketch that
      // says "Serial" and replace it with "Serial1" (or whatever number you are using).
      /*
      // I am going to change the Serial baud to a faster rate (optional):
      delay(500); // This dalay is just in case the nextion display didn't start yet, to be sure it will receive the following command.
      Serial.print("baud=38400"); // Set new baud rate of nextion to 38400, but is temporal. Next time nextion is
      // power on, it will retore to default baud of 9600.
      // To take effect, make sure to reboot the arduino (reseting arduino is not enough).
      // If you want to change the default baud, send the command as "bauds=38400", instead of "baud=38400".
      // If you change default, everytime the nextion is power on is going to have that baud rate.
      Serial.write(0xff); // We always have to send this three lines after each command sent to nextion.
      Serial.write(0xff);
      Serial.write(0xff);
      Serial.end(); // End the serial comunication of baud=9600.
      Serial.begin(38400); // Start serial comunication at baud=38400.
      */
      } // End of setup
      void loop() { // Put your main code here, to run repeatedly:
      variable1++; // Increase the value of the variable by 1.
      if(variable1 == 201){ // If the variable reach 201...
      variable1 = 0; // Set the variable to 0 so it starts over again.
      }
      // We are going to send the variable value to the object called n0:
      // After the name of the object you need to put the dot val because val is the atribute we want to change on that object.
      Serial.print("n0.val="); // This is sent to the nextion display to set what object name (before the dot) and what atribute (after the dot) are you going to change.
      Serial.print(variable1); // This is the value you want to send to that object and atribute mention before.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      // We are going to update the progress bar to show the value of the variable.
      // The progress bar range goes from 0 to 100, so when the variable is greater than 100, the progress bar will keep showing full (100%).
      Serial.print("j0.val="); // This is sent to the nextion display to set what object name (before the dot) and what atribute (after the dot) are you going to change.
      Serial.print(variable1); // This is the value you want to send to that object and atribute mention before.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      // We are going to update the gauge to show the value of the variable.
      // But instead of updating the gauge directly, we are going to send the value to a variable called va0 on the nextion display.
      // On the nextion display we have a code on the timer (tm0) that compares the variable value and the gauge value, and updates the gauge only when they are different.
      // The gauge range goes from 0 (pointing to the left) to 359.
      Serial.print("va0.val="); // This is sent to the nextion display to set what object name (before the dot) and what atribute (after the dot) are you going to change.
      Serial.print(variable1); // This is the value you want to send to that object and atribute mention before.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      // We are going to update the text to show "Hot!" when the variable is greater than 99, and show "Normal" when variable is below 100.
      if(variable1 > 99){ // If the variable is greater than 99...
      Serial.print("t0.txt="); // This is sent to the nextion display to set what object name (before the dot) and what atribute (after the dot) are you going to change.
      Serial.print("\""); // Since we are sending text we need to send double quotes before and after the actual text.
      Serial.print("Hot!"); // This is the text we want to send to that object and atribute mention before.
      Serial.print("\""); // Since we are sending text we need to send double quotes before and after the actual text.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      }else{ // Since condition was false, do the following:
      Serial.print("t0.txt="); // This is sent to the nextion display to set what object name (before the dot) and what atribute (after the dot) are you going to change.
      Serial.print("\""); // Since we are sending text we need to send double quotes before and after the actual text.
      Serial.print("Normal"); // This is the text we want to send to that object and atribute mention before.
      Serial.print("\""); // Since we are sending text we need to send double quotes before and after the actual text.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      }
      // We are going to hide the progress bar if the variable is greater than 119:
      if(variable1 > 119){ // If the variable is greater than 119...
      Serial.print("vis j0,0"); // This is to hide or show an object. The name of the object comes before the comma, and after the comma goes a 0 to hide or 1 to show.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      }else{ // Since condition was false, do the following:
      Serial.print("vis j0,1"); // This is to hide or show an object. The name of the object comes before the comma, and after the comma goes a 0 to hide or 1 to show. Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      }
      // We are going to change the color of the progress bar to red if the variable is greater than 49, and change to green if is below 50:
      if(variable1 > 49){ // If the variable is greater than 49...
      Serial.print("j0.pco=63488"); // Change color of the progress bar to red.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      }else{ // Since condition was false, do the following:
      Serial.print("j0.pco=1024"); // Change color of the progress bar to green.
      Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
      Serial.write(0xff);
      Serial.write(0xff);
      }
      } // End of loop
      this is the only code that worked with the arduino. Hope it helps?.

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

      Do you connect the Nextion directly to computer or through Arduino? To program the Nextion with Serial you must disconnect from the Arduino and connect it to pc using a usb to serial device.

    • @vincent8368
      @vincent8368 3 ปีที่แล้ว

      ​@@CheapControls Thank you very much for this quick response! I have found a solution to the problem, by accident haha! I am writing it here to help other fellow nextion enthusiasts. Basically, if you directly upload the arduino code to the nextion, it will NOT work. You first need to upload the tft file, and then upload the code to the arduino with the blue wire plugged out, then reconnect it. I am so happy to have found the solution, and I hope this helps others too!! Yes, I can now upload common sketches with the nextion.
      Thank you again!!!:))

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

      @@vincent8368 I am glad you figured out a solution.

  • @aguseguedre
    @aguseguedre 3 ปีที่แล้ว

    Hello ,
    First of all thanks for your videos.
    I'm following your method and it works when the two buttons (ON, OFF) are on the same page. But I want to make a screen where on page zero, pressing the ON button starts an output and also changes to page two. On this page there is another OFF button that stops the exit. I get the output to turn on by pressing ON, but if I press the OFF button on page 2 it only stops the output if I press it many times.
    I do not have the real screen I am using the PROTEUS simulator.
    Any ideas?

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

      I am not familiar with the PROTEUS simulator. But I will be looking it up. Do you have your buttons set to Global scope.

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

    thank you, very gread tutorial, can you upload coad and hmi file

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

      The code and HMI files are available at www.cheapcontrols.com Click on the the Nextion image and then look under the heading Nextion Tutorials.

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

    wich rx and tx do yo use ?

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

      On the Arduino? The Mega I usually use Serial2 on the nano and uno I use Software Serial and define it as Serial2

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

    Thanks! Yah.. I'm not a big fan of the Nextion library.

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

      I understand why people use it but I found it to complicated. Thanks for watching

  • @Yassin_Ro
    @Yassin_Ro 5 ปีที่แล้ว

    Hello, can i use the same method with stm32f4 ?

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

      I am not familiar with the stm32f4. Can you provide a link. When I google the item I do not get a Nextion model.

    • @vman6653
      @vman6653 5 ปีที่แล้ว

      Not familiar with the stm32f4, but I have used the same method with the arduino and with a PIC micro to talk to a nextion display. It gives you a lot of flexibility over what info is sent from the display and can make your final code more compact

    • @pravinpadale8787
      @pravinpadale8787 5 ปีที่แล้ว

      May be this has clues, I tried editing nextion.h as mentioned in the below link but no luck,
      nextion.ca/portfolio-items/nextion-iteadlib-and-stm32-step-by-step/

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

    Hi , can you help me to connect nextion lcd with wifi

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

      This is not a simple question. You would need to add something to the Arduino. The easiest would be to use an ESP8266 but we don't have videos on this yet. They are planned. You could possibly use a Raspberry PI but that would get pretty advanced. If you are not in a hurry we will have ESP8266 videos coming but I can't give you any definite dates. Hope this helps

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

      Cheap Controls thank you i hope your video can help me to do my fyp ?

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

    Use Serial.readString() instead of appending

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

      I prefer appending data because it gives me more control if I read one character at a time. I have combined multiple commands sent from the Nextion into a single string ad this method allows me to breakout of the collection based on partial data. I do understand what you are recommending and I understand why you would prefer that way. The nice part of the Arduino is there are many ways to complete a task.

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

      Yes, you're right. The result the one that matters

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

    My name is indra from indonesia, i use print "ABC" in nextion on button (bo), then i use Serial1 port on arduino mega, when i prees the button more then one time, the result on serial monitor seem like this
    ABC
    ABC
    ABC
    AB_
    ABC
    ABC
    ⸮JC
    AB_
    AB⸮
    ABC
    AB⸮
    ABC
    ABo
    ABC
    ⸮JC
    i need help
    thanks

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

      It looks like your strings are getting out of sync. I made a follow up video that goes into more detail th-cam.com/video/b9j7fX45qDo/w-d-xo.html

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

      @@CheapControls i try to connect nextian power to arduino board and then result ok, no problem found..
      i think the problem is power source

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

    Where do I start from?
    Introduce nextion,
    Introduce the ide you are using I don't even know the name
    Show connection diagrams and probably libraries
    Before going ahead with a lecture on it.

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

      Sorry but that is not what my channel is all about. It is more just ramblings of an insane person that got stuck in a electronics lab and cant find his way out. Seriously, I appreciate you watching and commenting

    • @quickfixengineeringltd8035
      @quickfixengineeringltd8035 3 ปีที่แล้ว

      @@CheapControls I appreciate you more for putting out content here for the community to develop themselves with. Please refer me to your first video on nextion. I am currently building an inverter and I want to make maximum advantage of a touch screen display. Thank you

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

      I think this is my first video on the Nextion. There is no order, I think you can search my channel on TH-cam for any topic you are looking for. Sorry, but I don't have a dedicated tutorial. I have been considering making a series. I think this video could use an update.

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

    can you show the same method on a raspberry pi

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

      Yes, I can, I will try to get one up next week Thanks for the video idea and consider joining the private cheap controls Facebook group. We can have a better conversation there and I can cater the video more toward your needs. I find that if one person is asking for something there are probably others that have the same question. If you don't join, no worries, look for a video on this next week.

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

      I have been looking into this. The pi has more functionality than the Arduino. I need to know how you use the pi. Are you a command line user or a GUI user? I am working up a video on how to tie a Nextion into a Raspberry Pi as a web server to control a simple light connected to the Pi. If you are a GIU user this might not be for you.

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

      @Blondie SL I took a little break from making videos. I will be starting back up after the 4th of July. This OctoPrint might be a stretch but I will look into it.

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

    Trying to make an LED on pin 9 turn On or Off and I can't get this to work using the method in the video. I can see the serial monitor receiving the PWR ON and PWR OFF messages from the Nextion screen but the LED is not turning on or off when pressing the buttons. I'm using the code from the tutorial and added my LED code to it. I've attached the code below, If anyone knows what I'm doing wrong please let me know. Thanks!
    int Blue_led = 9;
    void setup() {
    // put your setup code here, to run once:
    Serial.begin(9600);
    Serial.println("HEllo World");
    pinMode(Blue_led, OUTPUT);
    }
    void loop() {
    // put your main code here, to run repeatedly:
    if(Serial.available()){
    String data_from_display="";
    delay(30);
    while(Serial.available()){
    data_from_display = char(Serial.read());
    }
    Serial.println(data_from_display);
    //sendData(data_from_display);
    }
    }
    void sendData(String data_from_display){
    if(data_from_display == "ON"){
    Serial.println("PWR ON");
    digitalWrite(Blue_led,HIGH);
    }
    if(data_from_display == "OFF"){
    Serial.println("PWR OFF");
    digitalWrite(Blue_led,LOW);
    }
    if(data_from_display == "MAIN"){
    Serial.println("MAIN COMPUTER");
    }
    if(data_from_display == "LAP"){
    Serial.println("LAPTOP");
    }
    if(data_from_display == "DOC"){
    Serial.write("DOCUMENT CAMERA");
    }
    }

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

      What type of Arduino are you using, UNO, MEGA, NANO? Make sure you have the serial port pins connected correctly

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

      @@CheapControls I'm using a genuine Arduino UNO

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

      @@CheapControls The serial pins should be connected correctly because I can make it work using the Nextion Library. I would much rather use your method which is a lot simpler and clean :( See the the code below using the Nextion Library and I confirm that this works right now on my desk so the pins should be connected correctly.
      ----------------------------------------------------------------------------------------------------------------------
      #include
      //define LED PINS ON ARDUINO
      const int Blue_led = 9;
      //Declare your Nextion objects , pageid, component id., component name
      NexButton b0 = NexButton(0,2,"b0");
      NexButton b1 = NexButton(0,3,"b1");
      NexText t0 = NexText(0,4,"t0");
      //Register a button object to the touch event list
      NexTouch *nex_listen_list[] = {
      &b0,
      &b1,
      NULL
      };
      //Button b0 component popcallback function
      // When ON button is Released the LED turns ON and the state text changes
      void b0PopCallback(void *ptr){
      t0.setText ("State:ON");
      digitalWrite(Blue_led,HIGH);
      }
      //Button b1 component popcallback function
      // When OFF button is released the LED turns OFF and the state text changes
      void b1PopCallback(void *ptr){
      t0.setText ("State:OFF");
      digitalWrite(Blue_led,LOW);
      }
      void setup(void) {
      Serial.begin(9600);
      nexInit();
      //Register the pop event callback function of the components
      b0.attachPop(b0PopCallback,&b0);
      b1.attachPop(b1PopCallback,&b1);
      //TURN OFF BLUE LED WHEN TURNING ON SYSTEM.
      pinMode(Blue_led,OUTPUT);
      digitalWrite(Blue_led,LOW);
      }
      void loop() {
      nexLoop(nex_listen_list);
      }

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

      @@marvg7062 I will look a little closer at your code and replay in a bit.

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

      @@CheapControls thanks very very much!

  • @rikardfrid2679
    @rikardfrid2679 10 หลายเดือนก่อน

    Maybee I'm stupid but howto connect the Nextion against the Arduino sry I'm a newbie 57years old

    • @CheapControls
      @CheapControls  10 หลายเดือนก่อน

      It depends on the Arduino. I use the Nano in most of my tutorials, but it would be the same for the Uno. I use a library called software serial and define two pins( usually 2 and 3) as a software serial port. I use those pins to connect to the transmit and receive on the the Nextion. Using an additional serial port allows you to keep the arduino connected to the IDE and use the serial monitor for trouble shooting.

    • @CheapControls
      @CheapControls  10 หลายเดือนก่อน

      You are only a couple of years older then me. Never to old to learn something new.

  • @beata-anitagerger4109
    @beata-anitagerger4109 3 หลายเดือนก่อน

    It doesn't work.

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

    Who else wasted 2 hours on this not working

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

      Sorry you had troubles. If you go to cheapcontrols.com and submit a comment with your Email address I will reply and you can submit your code for review. Thank you for giving it a try.

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

      @@CheapControls update that may help others, there is a "rare" lost bauds documented in the nextion instructions. My Arduino and ide monitor were set to 9600 as well as the nextion but the nextion insisted on using 115200 baud without telling me which I found by changing serial monitor baud rate until it didn't display gibberish