How to send and receive number and string between Nextion and Arduino in a specific page

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024
  • This video Shows you how to send and receive values as integer and string from Nextion to arduino and from arduino to nextion.😍
    In addition this video can teach you how to send and receive values in any specific page you want.😍
    Download library from here😍👇
    drive.google.c...
    Now let's download the arduino code from here 🔥😍👇
    drive.google.c...
    And here the Nextion HMI file:😍👇
    drive.google.c...
    Here the video about how to play Audio in nextion HMI Screen👇👇
    • How to use audio or mu...
    If you have any question, don't hesitate and leave a comment below,
    And don't forget to Subscribe to our channel to see our new upcoming videos ❤❤
    #arduino #nextion #educational

Комментарии • 82

  • @MEKATRONIKCI
    @MEKATRONIKCI Год назад

    شكرا كتير واحسن سوري يحكي انكلش على العالم😂

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      ههههه يا هلا، اول تعليق عربي اجا على اسمك، التطور مهم حتى لو درجة درجة، معك من لبنان. شكرا يعطيك العافيه👏👏

    • @MEKATRONIKCI
      @MEKATRONIKCI Год назад

      @@RoMecha_lb جزاكم الله خيرا 🤗

  • @thetruth-dh7br
    @thetruth-dh7br 2 года назад +1

    Excellent, I've been looking for a video like this for a long time, thank you very much

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      you're welcome, we are going to upload a lot of tutorials in our channel, stay tuned dude ❤❤

    • @thetruth-dh7br
      @thetruth-dh7br 2 года назад

      @@RoMecha_lb
      Thank you so much
      I hope it will be soon
      Since I have been trying for a while to make my own project based on RTC DS1370, nextion screen, arduino and temperature sensor
      But I could not display or modify the time and date on the screen

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      @@thetruth-dh7br first of all, if you have a nextion intelligent type, you can do your real time clock inside the nextion screen,and we have just released a new video about internal rtc in nextion check it if you need. Now if you have a problem regarding the serial communication with your arduino, check the serial communication tx should be connected to arduino rx and vice versa. also check your library and maybe it's a hardware problem

  • @francescoromano4772
    @francescoromano4772 Год назад

    Simply the best video and libray of nextion so far

    • @RoMecha_lb
      @RoMecha_lb  Год назад +1

      Thank you!!
      Glad to hear that from you👏👍

    • @francescoromano4772
      @francescoromano4772 Год назад

      @@RoMecha_lb can you male a video were you show how to Blink 2 led usigng numbers in differtent pages?

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      @@francescoromano4772 i will try to do like this tutorial, but in order to not be late and if you have a specific command you need to do, simply tell me more, so that i can help you.

    • @francescoromano4772
      @francescoromano4772 Год назад

      @@RoMecha_lb the aim is to be able to turn on and off two LEDs using the millis and to be able to adjust the on and off time with the numbers on the nextion display, however, everything must not be lost when you change the page and the on and off sequence that is set must continue

  • @SparkofMagic
    @SparkofMagic Год назад

    Great video! very informative.
    I was wondering, can the Nextion display make a calendar to record the events that he receives from arduino on specific dates and than show a calendar that you can choose a date and see what event accrued on that date?

    • @RoMecha_lb
      @RoMecha_lb  Год назад +1

      Hello Dear,
      in fact yes you can do it, but it needs more work to do it. For example first you need to send your needed data from arduino to nextion screen, then you need to save it inside the nextion Eeprom to avoid losing the information. then you need to use the RTC(real time clock) and do an algorithm to set your data or on the other way, you need for example to count how far the event will happen, you need to do and think for it. But i need to tell you that yes you can do it of course.

  • @rockrock4478
    @rockrock4478 Год назад +1

    Hello.
    My question is how to add to the sketch so that when receiving the number 1 from Nextion , for example, turn on the built-in LED, and when receiving 0 turn it off?

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      Hello, this is a simple operation, all you need is to read the value send from the nextion to the arduino. then put an if statement(example if this value=0, means let the led turn off and vice versa).
      No worry, it's a simple operation and you can do it simply.

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      watch carefully our video. you should got it.

  • @Drxxx
    @Drxxx 2 года назад +2

    Super video

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      Thank you!!
      Glad to hear that from you ❤

  • @boksakv
    @boksakv Год назад

    Hi to all, its great video and great job you do with comments and help. I am trying to make some timer with arduino and in the code I have unsigned long No1 and unsigned long No2 for pause and action. My question to you is there a way to make changes of this two values over nextion screen?

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      Hello Dear,
      First glad to hear that from you.
      Second Let's start helping you, of course you can control both timers from your nextion hmi using multiple ways, the simplest is to create one nextion page followed by two command to be send to the arduino. then when you receive them, you can adjust your arduino depending on your need to be able to control your timers.

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      if you have no idea about them, simply contact us and no worry we need to help you.

  • @Josh-ky2zt
    @Josh-ky2zt Год назад

    nice video, i have a question. In the send number function, it is possible to just send a number value for example if i set 120 in numeric keyboard the serial monitor just show 120 ? thanks sir

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      Hello Dear, of course you can, but please send me specifically your need, i will help you no worry

  • @carminezecca6179
    @carminezecca6179 2 года назад +1

    Hello, is possible on nextion put the limits ,example if i receive text over than 100 and below 40, i want to show the string"over"?
    thank you

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      Hello Dear,
      Yes of course you can, but first are you using arduino with nextion right? then where you want to write this specific code?

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      No worry, it's easy to do

    • @carminezecca6179
      @carminezecca6179 2 года назад

      Hello thank you, is better in the nextion....

    • @carminezecca6179
      @carminezecca6179 2 года назад

      I explain better, i receive a string from arduino, so I need a text box, and set minimum and maximum which I decide , ( using two arrows one for setting minimum, and other for setting maximum.).
      I know how to do it in arduino or ST , but I do not know very much about nextion setting ....
      Thank you

    • @RoMecha_lb
      @RoMecha_lb  2 года назад +1

      @@carminezecca6179 hello Dear carmine, let's help you,
      First you can use this command :👇👇
      strlen t0.txt,n0.val
      // means store the length of to.txt and put it in n0.val
      to: is the text name
      n0: is the storage of your text lenght
      And the rest is easy for you to write if statement or anything else
      good luck, if you have any other question, we are here to help.

  • @carlotucarellarr9026
    @carlotucarellarr9026 4 месяца назад

    how do i read Xfloat values from the nextion screen? i only see string and number

    • @RoMecha_lb
      @RoMecha_lb  4 месяца назад

      Define a value inside the arduino as float value, then add a number as float on the nextion Hmi. then you'll be able to read

  • @stephanbuth8195
    @stephanbuth8195 Год назад

    it is working now with hardware serial😀. But if i want to use SoftwareSerial, what definition goes in the (Serial) field --> EasyNex myNex(Serial); ?

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      Great Work dear 👏👏👏
      glad that your problem was solved😀, Now regarding the hardware and software serial, (serial) means your serial zero or the nominal tx and rx serial communication, but if you want to assign another serial, i'm not tried it before, but i think you can simply do it like any other component, so that you can assign another tx and rx pins. Finally i want to know where was your last problem, how did you solve it👏👏

  • @davidsilvavelazquez7214
    @davidsilvavelazquez7214 Год назад

    could i send decimals variables?

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      yes, one of the method to do that is to convert your number from 7 & to decimal and then send it normally

  • @jonnavydelacruz3300
    @jonnavydelacruz3300 2 года назад

    can you make calcu but the show screen is in the next page?

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      Hello, can you please specify what exactly you need?
      we are ready to help you

    • @jonnavydelacruz3300
      @jonnavydelacruz3300 2 года назад

      @@RoMecha_lb I have 10 words and each word have 10 words also, if I choose 1 word it will open 10 words and whatever I pick you will see in the top corner.. can you make a video of it?

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      @@jonnavydelacruz3300 In fact, we are going to record and upload some tutorials related to Nextion Hmi screen as soon as possible. We will take your topic and put it in our list. Now i will give you some advice in order to make your idea, first you can create it for example by using buttons or another options. For buttons you can simply put an if statement for each push, then if button 1 pressed, you can simply display the 10 words that you need inside a text and the same for the other buttons. Again you can do it by using multiple ways or multiple tools.
      Tell me please if i got your point or not.
      Thank you.

    • @jonnavydelacruz3300
      @jonnavydelacruz3300 2 года назад

      ​@@RoMecha_lb thank you very much, you got my point.. your awesome

  • @claytonjandeliverio6348
    @claytonjandeliverio6348 2 года назад

    what do you mean by printh 23 02 50 00???

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      this numbers is used in the easy nextion library, so you need to write it in order to know which page your are opening

  • @aldiprasetyo4766
    @aldiprasetyo4766 Год назад

    it's a good video, but i'm still confused to do my project. I have to send the value of a sensor to nextion on a certain page, but I still don't understand how to make the Arduino code, because here it turns out you haven't explained it in detail.

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      Hello Dear, it's a simple way to understand. simply download the library and it's very easy to send and receive. if you need more specific help let me know. i can help you

    • @aldiprasetyo4766
      @aldiprasetyo4766 Год назад

      @@RoMecha_lb I'm still confused about the Arduino program to call the page. So I have to bring up the value from the reading of the ultrasonic sensor on page 3 in the design nextion editor and also have to send the setting point on page 3 too, can you help

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      @@aldiprasetyo4766 let me tell you briefly, in the arduino code, as you can see when you open for example page 3 on the nextion screen, your arduino code will run in the function that has the name page 3(as you see in the code). So you need to get the right address of the page and you need to know the name of the label and the text you want to use(check this point it may cause errors and no reading), then you can simply send and receive whatever you need. to clarify, i recommend you to upload my both codes and run them to see how they work. and Finally when you try let me know if you face another errors. i can help you no worry

    • @aldiprasetyo4766
      @aldiprasetyo4766 Год назад

      @@RoMecha_lb ok i will try. I want to ask again, what pin should be connected to the RT TX on the Nextion

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      @@aldiprasetyo4766 Simply without any modification, you need to connect the Tx of the nextion to the Rx of the arduino and vice versa. also in this case remember to unplug both tx and rx wires of the arduino while uploading the code

  • @claytonjandeliverio6348
    @claytonjandeliverio6348 2 года назад

    do you have a tutorial that would input a number in nextion and would send to the arduino that would change the brightness of the LED

    • @RoMecha_lb
      @RoMecha_lb  2 года назад

      So far we don't have it, but it's a good idea to upload a tutorial about it👍👍

  • @akashgz
    @akashgz Год назад

    text 1 is error text 2 is error
    getting

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      try checking your wire communication, your nextion type, or your arduino and your library

  • @stephanbuth8195
    @stephanbuth8195 Год назад

    Hi, and thank you for that video!
    I am also getting these endless "text 1 is error text 2 is error" messages. The Nextion is running well with other codes with the Nextion.h library or without any library.
    I am using the Nextion with SoftwareSerial.h. at port 7,8.
    Can this cause problems with EasyNextion?

    • @RoMecha_lb
      @RoMecha_lb  Год назад +1

      Hello dear,
      normally you should not get an errors even if you're using software serial or hardware serial, but if you need to work well, try this sketch only using the normal hardware serial, if it's worked well, try to use the software serial communication, the goal of this trial is only to check if there is another problem that prevent you from reading or not. Again you can tell us if your problem fixed or not after testing, and feel free to contact us. it's our pleasure to help you to fix your problem. No worry 👏👏

    • @stephanbuth8195
      @stephanbuth8195 Год назад

      @@RoMecha_lb Thanks for the fast reply! I checked everything in the meantime and unfortunately there is no matter if i use softwareserial or not.
      The serial monitor shows an endless loop of this data:
      page 0⸮⸮⸮get t1.txt⸮⸮⸮get t1.txt⸮⸮⸮get t2.txt⸮⸮⸮get t2.txt⸮⸮⸮t3.txt="mecha"⸮⸮⸮t3.txt="mecha"⸮⸮⸮t4.txt="Eng"⸮⸮⸮t4.txt="Eng"⸮⸮⸮
      text 1 is ERROR
      text 2 is ERROR
      page 0

    • @RoMecha_lb
      @RoMecha_lb  Год назад +1

      @@stephanbuth8195 since it gives you the correct value of page 0, it means that you have no problem with your serial communication, did you check well your text names in your Nextion Hmi? it should be similar to the Arduino names inside the code, like text1 or text2 or anything. Again i need to help you no worry, but let me know if this is your issues or not.

    • @RoMecha_lb
      @RoMecha_lb  Год назад +1

      if not, try if you chose the correct nextion type, try if you reversed your tx and rx, and lastly check your wire connection, maybe some wire of them has not worked or cut, and lastly the important one, did you connect the ground of the arduino with the nextion together?
      try this options one by one and i think you'll be ok

    • @stephanbuth8195
      @stephanbuth8195 Год назад

      @@RoMecha_lb Arduino and Nextion are working well together in all other cases. I can send and receive values but not with the easyNextion.h
      And it is no bug only in your code, because also the built-in examples of easyNextion.h put that "garbage" on the serial monitor. It looks like a handshake problem with wrong baud rates but both devices are @ 9600baud. I am using the 2,8 basic version and of course i switched the device and orientation in the Nextion software.

  • @kunalpandhram7501
    @kunalpandhram7501 Год назад

    hello sir, i am working on nextion display. i am controlling light using nextion . so i am facing some issues so can i get your mail id ?

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      hello dear, kindly contact us via facebook page if you want to send us any image or any documents,
      of course we can and we need to help you achieve your goal

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      also, we have made a tutorial on how to control an led using nextion hmi screen, kindly check it if you need

  • @arfathasan3329
    @arfathasan3329 Месяц назад

    Respected Sir ! Download your project and run my pc but result is not found on my monitor. Please guide me where is my mistake. I m waiting ur kind reply. my result is
    page 0
    get t1.txt⸮⸮⸮get t1.txt⸮⸮⸮get t2.txt⸮⸮⸮get t2.txt⸮⸮⸮t3.txt="mecha"⸮⸮⸮t3.txt="mecha"⸮⸮⸮t4.txt="Eng"⸮⸮⸮t4.txt="Eng"⸮⸮⸮
    text 1 is ERROR
    text 2 is ERROR

    • @RoMecha_lb
      @RoMecha_lb  Месяц назад

      Hello
      How are you?
      It seems that the only errors you have are with 'text 1' and 'text 2.' Make sure you are using the correct type, either string or number. Since some of the text is correct, it means the serial communication is working well. Try checking the names in both the HMI and Arduino to ensure they are identical. Let me know if you fix it or not

  • @honeyyao6546
    @honeyyao6546 Год назад

    hi sir! i'm having trouble with my nextion display. may i ask for your email address?

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      hello Dear, what is your problem? if you need you can simply write here the problem that you face, if not let me know. we are ready to help you

    • @honeyyao6546
      @honeyyao6546 Год назад

      i'm currently making an alarm clock wherein the user will input the set time and date (basically, im not using an RTC). i used a numeric keypad for the input part. the main problem is that the output value being sent to the arduino is not the output value being inputted, rather some bunch of random numbers and 77777.

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      @@honeyyao6546 ok, it seems that there is a trouble in your nextion, try checking well the communication between your arduino and nextion, check if you ground them together or not, then check if you have the right library installed. if not, i think you need to check multiple things.

    • @RoMecha_lb
      @RoMecha_lb  Год назад

      i need to help you, so try them and let me know

    • @honeyyao6546
      @honeyyao6546 Год назад

      @@RoMecha_lb can i have your mail id? so i can explain it better with you

  • @ates16871
    @ates16871 8 месяцев назад

    hi sir! i'm having trouble with my nextion display. may i ask for your email address?

    • @RoMecha_lb
      @RoMecha_lb  8 месяцев назад

      Hii, Yes of course
      Send to this address:
      romecha.lb@gmail.com

    • @ates16871
      @ates16871 8 месяцев назад

      @@RoMecha_lb OK, I have sent you an email. have you received it? My name is ates1687.