137 Sending values and text

Поділитися
Вставка
  • Опубліковано 24 лис 2024

КОМЕНТАРІ • 90

  • @freytube1
    @freytube1 Рік тому +1

    Best video on UA-cam about nextion great job . The send b01 requires a few hits to input new value. If using one serial port only

    • @CheapControls
      @CheapControls  Рік тому +1

      Thank you, Most of the time I use software serial so I can have two ports

  • @MichelMartins-hs8vs
    @MichelMartins-hs8vs Рік тому +1

    Many thanks for great job you guys are doing. Your videos has help me a lot.
    And the most good things of your videos are point of not use Library, so can I understand how it works.

    • @CheapControls
      @CheapControls  Рік тому

      I am glad you like them and thank you for taking the time to comment

  • @avrphreak9121
    @avrphreak9121 3 роки тому +1

    Thank you! As i commented in other video, this really helps! Many thanks for you effort and taking the time to explain at normal pace!

    • @CheapControls
      @CheapControls  3 роки тому +1

      I am really glad you like them. I enjoy making them.

  • @abhijitrashinkar
    @abhijitrashinkar 4 роки тому +2

    Hi!
    Much needed, many thanks, you are too good with NEXTION as usual.

  • @ruben34
    @ruben34 3 роки тому +1

    Thanks alot for this video. It was very helpful. I also found it easier to use serial2 and prints communication than the Nextion librarie.

  • @DS-mo6md
    @DS-mo6md 2 роки тому +1

    I am still learning I have an uno R3 and a nextion 2.4 discovery... but before I get too far I figure to ask my goal. I have a powered spoiler (via linear actuator ) for a vehicle and I had a cool idea to be able to see its position . Actuator has no feedback control so I cant use like a knob and use it to set positions like a dial.. So my idea was to make a cool custom gauge and "animation". I think im going to use a waterproof ultra sonic sensor to ping from the roof to the rear of the spoiler... Now I havent even looked if this is capable but will I be able to set images ( say like 50 images) to different MM values of the rangefinder? The DPDT momentary switch I will just keep separate but the nextion / arduino will tell me its position, lift or drag and degrees ( will be plugged in manually to the animation roughly )

    • @CheapControls
      @CheapControls  2 роки тому

      This sounds like an interesting project. What is the distance between measurements. Some distance sensors do not work as well as others.

    • @DS-mo6md
      @DS-mo6md 2 роки тому

      @@CheapControls well the aoyy is like the only waterproof one with close range . I wish it were cheaper . I'm just not far along enough in my education. I just got my editor to work and compile then have to figure out why the range sketch was showing an error.. I never thought to make sure the range in mm could be coded as values for individual images. It seems basic but yeah. Originally I thought a seven segment would be fine to show like a one to five or ten value to know angle of attack. Then discovered nextion and since some other systems are using cool digital gauges thought it would be awesome to learn how to make my own. Well code and install gadgets anyway. But range wise it's probably 10 to 20 cm at full tilt . Actuator is four inch . There's a cheaper waterproof but it's long range. I would use a laser if I could waterproof it but I hear they glitch with uv light

    • @CheapControls
      @CheapControls  2 роки тому

      It sounds like you are figuring it out. I wish you luck. I am not sure what an aoyy is but waterproof sounds like what you would need.

  • @Hermit_of_the_Holler
    @Hermit_of_the_Holler Рік тому

    First, thank you for creating this video.
    Question: How do we approace the Send Value and receive if the sent vales are of different lengths?
    In your example we know that each field is 3-characters in length (123,456,789).
    What if we send 123 but next time it is 42 and then 12345..? How do we decode at the arduino side to ensure we get the correct characters and not mix fields 1 & 2 for example..?
    Also, what if there is a decimal involved..?? 123.4
    Thank you for your time

    • @Hermit_of_the_Holler
      @Hermit_of_the_Holler Рік тому

      Could we use the parseFloat command somehow..??

    • @CheapControls
      @CheapControls  Рік тому

      Nextion does not recognize floats. If I want to display a float I usually send it as text. If I need to manipulate the value in the Nextion I multiply the float by 100 and send it as an integer. Then I use the xfloat object on the Nextion to set the decimal place. I have a set of videos on the float ua-cam.com/video/dMXFaV2q1fY/v-deo.html -- Sending values to the arduino I have a newer way of doing this that uses a key-value pair. The key is the command and is set to a specific number of characters and the value can be random length. ua-cam.com/video/b9j7fX45qDo/v-deo.html

    • @Hermit_of_the_Holler
      @Hermit_of_the_Holler Рік тому

      @@CheapControls thank you.
      I'll try that tonight when I get home and post a comment here

  • @OmidAtaollahi
    @OmidAtaollahi 8 місяців тому +1

    you saved a heck of time

  • @john2478
    @john2478 8 місяців тому +1

    Your excellent videos are what made me confident that I should be able to set up a Nextion tft with Esp32 demos d1 board.
    I have had no problem in placing buttons and getting them to interact as required. However I seem to be a bit stumped in getting anything to go from the Esp32 to the Nextion or vice versa. I have set up the code with 2 serial ports and so far have no errors compiling. I definitely do not have a hardware problem as I have duplicates of everything. I can compile the respective codes and download to both the Nextion and the Esp32. In going through your code in this #137 video, I have a problem with.... prints "val".0. which throws up an error code... Invalid number of arguments. If I enter prints n0.val.0 I I get 2 errors....Invalid number of arguments. I have tried going to your site and downloading and copy of your code to try but the link is not working.
    In you tutorial 59 you said that you couldn't get prints working. Have I missed something somwhere?
    Finally I have a wretched error message says invalid variables page. Actually I dont have one as I deleted it! so have no way of getting error free code.
    Can you help please. John

    • @john2478
      @john2478 8 місяців тому +1

      I have managed to sort this out. The.. prints."val".0 only works if you put the number of characters that the val is. i.e. ...prints"val".3
      The prints n0.val,0 that gave me errors works but with .....prints n0.val,0 ...I managed to get rid of the other error message about variables by using an erilier version f the file and updating it.
      Incidentally in hex when checking the data going out to the ESP I saw that if you use values of less than 10 you can see the figures rather than the hex figures so it is easy to se if it is working correctly. I also had a good look at the Nextion instruction set to check for the correct way of writing the code.
      John

    • @CheapControls
      @CheapControls  8 місяців тому

      I am glad to hear you figured it out and I will take your other comments into consideration. I have not been able to work on the displays recently but I hope to get back into them soon.

  • @vincentledbetter5691
    @vincentledbetter5691 2 роки тому +2

    So when I do this, all it serial prints is ☐ and every time I hit send, it just prints another one.

    • @CheapControls
      @CheapControls  2 роки тому

      I reply to all comments but I think this one was answered in an Email. Thanks for watching and your support over at Ko-Ki

  • @freytube1
    @freytube1 Рік тому +1

    for additional numbers to sent& receive I created two more unions , do I need to re name Val in nextion?
    prints "Val" ,0
    prints n3.val,0
    to for example
    prints "Val1",0
    prints n4.val,0
    etc
    Regards

    • @CheapControls
      @CheapControls  Рік тому +1

      when you send it as a string prints "Val1",0 you don't need a union. When you send prints n4.val,0 you need the union. If you are storing the value received in the union for later use, you would need multiple unions. Please rephrase the question if I did not give you the proper answer.

    • @freytube1
      @freytube1 Рік тому +1

      prefect answer as always I am re using the value to run temp and servo controllers @@CheapControls

    • @CheapControls
      @CheapControls  Рік тому +1

      Glad I was able to help. That is an older video. I don't send values very often so I have to stop and think a bit about how I use it when I do.

    • @freytube1
      @freytube1 Рік тому

      nothing wrong with "OLD" since I am one LOL@@CheapControls

  • @JLopez-qw6yd
    @JLopez-qw6yd Рік тому +1

    could you do a video with Arduino portenta machine control and Nextion? using a RS485 to TTL convertor Thanks! Also where can i download the code you write as a reference?

    • @CheapControls
      @CheapControls  Рік тому

      I can not afford the Portenta. Maybe down the road. Thanks for watching and taking the time to comment.

    • @JLopez-qw6yd
      @JLopez-qw6yd Рік тому +1

      @@CheapControls thank you for your great instructional videos, is there a way i can get your code to use as reference? Thanks!

    • @CheapControls
      @CheapControls  Рік тому +1

      go to www.cheapcontrols.com. On the need help page, you can request the code.

  • @DD-jj2tc
    @DD-jj2tc 3 роки тому +1

    It's hard to see the comma after val thank God for the nextion reference

    • @CheapControls
      @CheapControls  3 роки тому

      I am not sure I would thank God for this. I would thank him for my children and my health and my incredible wife and I suppose God is responsible for all things so I guess you are right. Thank God for the Nextion reference and the ability to purchase such a product at such an affordable price. Even though their help desk is not exactly heavenly. Honestly, thank you for watching and supporting my videos.

  • @cicicicil7159
    @cicicicil7159 9 місяців тому +1

    thank you, but i am strugle to sending text(string) can u explain it to me?

    • @CheapControls
      @CheapControls  8 місяців тому

      You have to go to www.cheapcontrols.com and request help.

  • @jwiedmayer
    @jwiedmayer Рік тому

    Any idea why the endChar errors out with - non known conversion for argument 1 from 'String' to 'const char*', exit status 1, no matching function for call to 'HardwareSerial::write(String&)'

    • @CheapControls
      @CheapControls  Рік тому

      Did you download the code from www.cheepcontrols.com/videodetail.html?id=12 to compare with your code?

  • @Ron16278
    @Ron16278 3 роки тому

    Can you please make a video of the Nextion display with Arduino Mega, Uno or Nano
    and a BME280 sensor without Nextion.h?
    Output the three values (temperature, air pressure, humidity) from the BME280
    in three X.float components on the Nextion.
    thanks

    • @CheapControls
      @CheapControls  3 роки тому

      I ordered a BME280 today. I should have it next week and will look into making a video. I get lots of questions about sending float values to the Nextion.

  • @dronie8782
    @dronie8782 3 роки тому +1

    Hello, I'm trying to understand your example, not obvious in English ... can your example be applied to a contact form?

    • @CheapControls
      @CheapControls  3 роки тому +1

      Do you mean having a contact form on the Nextion and sending multiple items at one time?

    • @dronie8782
      @dronie8782 3 роки тому

      yes I would like to use the Nextion screen to send a contact form (last name, first name, etc ...) to the arduino and save on an SD card. is this possible, what should I change in your example? a big thank-you

  • @tehnostation
    @tehnostation Рік тому +1

    line 27: asyncDelay === delayLength. Why this?

    • @CheapControls
      @CheapControls  Рік тому +1

      I pulled up the file I used in the video and I am not sure I have the same file. My line 27 does not look like that line. Will cut an paste a few more lines around that one? I can't remember why I would do it that way. I know back then I was more concerned with the millisecond register hitting it's maximum value and rolling over to 0 but I don't think that line has anything to do with that. Sorry I am not of more help.

    • @tehnostation
      @tehnostation Рік тому

      @@CheapControls Thanks a lot for the answer.

  • @jimbooth2010
    @jimbooth2010 2 місяці тому

    Hi, i am spending a lot of time trying to solve what I would have thought would be an easy thing to do. I have a string or text value in nextion. Lets say its "12.4". I want to change the graphic if that value changes to "12.6". I have tried to convert to a number and multiply by 10 to get 126 or 124 but no luck. It seems to drop the ".6" or ".4". I must be trying to do something that there is a better way to solve. Any ideas? got a video on this? btw, i am trying to solve this using the script in nextion. perhaps I should be trying to use the esp32 to send the decimal or number to nextion and acting on the incoming information.

    • @jimbooth2010
      @jimbooth2010 2 місяці тому

      found a solution. I multiplied the value by 1000 so 12.3 became 12300. then used the float field and set the ws0 to 2 and the ws1 to 3. so, in the field 12.3 displays as 12.300 which is fine with me. but in my conditions statement, i have to compare the values using the value multiplied by 1000. for example if(x0.val>12200&&x0.val

  • @Good-Enuff-Garage
    @Good-Enuff-Garage Рік тому

    looking for the exact opposite of this video, I want to send values and text from the Arduino to the Nextion

    • @CheapControls
      @CheapControls  Рік тому

      When this happens you have to watch the videos hanging by your feet. Then they appear to do the opposite. Sorry, I am not sure how to respond to this comment. I am glad you are taking the time to put in all the comments. keep them coming.

  • @javierviana96
    @javierviana96 2 роки тому +1

    Quick question: When your declare in the Send Value botton:
    Prints "val".0
    Prints n0.val.0
    Prints n1.val.0
    Prints n2.val.0
    What is that .0 at the end of each prints stand for? The number of the page?
    Thank you before hand if this works, the Official library is a mess and the getValue function doesn't works, It's a shame they haven't update a new version since 2016

    • @CheapControls
      @CheapControls  2 роки тому +1

      It is the length of the string you want to send. Setting it to 0 makes it the length of the string. If you put a value in you can create a more static value. The only time I see setting a value is if you are using a string variable and you are not sure how big it is and you want to set the length to a set length no matter what the variable is.

    • @javierviana96
      @javierviana96 2 роки тому

      @@CheapControlsmany thanks for the info!

    • @javierviana96
      @javierviana96 2 роки тому +1

      Mmm not working... Not enterely sure why... The thing is I'm trying to store both numbers in different values, one for time and the other for temperature I did as you said making two different unions for eachother but It isn't working... Could It be because i have more than one page?

    • @CheapControls
      @CheapControls  2 роки тому

      If you have multiple pages and you try to write to an object on an non visible page it will not work. You need to make any object that you want to write to on other pages global. Once you make an object global you must add the page to the front of the object string.

  • @thecalipercnc2800
    @thecalipercnc2800 Рік тому

    thank you very much for your tutorial
    i have problem that the screen keep sending the error message i have no idea why
    i have creat new nextion file with the same problem
    can you explain why it happend
    thank you

    • @CheapControls
      @CheapControls  Рік тому

      are you using print or println? The only way I can know for sure is to do a code review. You can request a code review at www.cheapcontrols.com on the help page.

  • @marthinvirgo1412
    @marthinvirgo1412 2 роки тому +1

    bro, i want to make code for command led from nextion with 2 led
    if value in n0 >= 10 and n1 >=20 both led 1 and 2 will be on
    if n0 >= 10 and n1 < 20 led 1 will on and another one off
    if n020 led 1 will off and another led will on
    and if n0

    • @CheapControls
      @CheapControls  2 роки тому

      I know the display can do this. You will succeed.

  • @iSuperMC
    @iSuperMC 3 роки тому

    Please do a video with esp32 with nextion

    • @CheapControls
      @CheapControls  3 роки тому

      I have planned on doing videos with the esp32 for awhile. It is hard to find time. I will do my best.

  • @azka4779
    @azka4779 3 роки тому

    I have a problem, when uploading its works fine but when i send the value from nextion to arduino serial, its shown strange number like 1}4 on the serial, i dont use 2nd display i just use nextion and serial

    • @CheapControls
      @CheapControls  3 роки тому

      do you have the "Send Component ID" box checked?

    • @azka4779
      @azka4779 2 роки тому

      @@CheapControls wait i have to try again from beginning, i messed up everything

    • @CheapControls
      @CheapControls  2 роки тому

      If at first you fail try again to success! I am sure you can get it.

  • @manuelrodriguezlatorre8978
    @manuelrodriguezlatorre8978 Рік тому

    Hello, I am communicating a s71200 with a nextion screen through a CM1241 RS232 module and a max3232 to convert RS232 to ttl. I have already managed to receive in the plc by pressing buttons created on the screen and numbers as well, with which I have achieved the reception part. However, when trying to send from the s71200 plc to the screen so that it shows me a numerical value in a field, I cannot get it to send and it does nothing, the Tx led on the CM1241 RS232 only blinks, so something is sending but it is not what correct. I have looked for information about all this in the instruction set but I can't find where I think the problem is, which is in the character frame. Does the display need a frame of characters or bytes to know or start receiving? I am trying to send in hexadecimal.

    • @CheapControls
      @CheapControls  Рік тому

      I would recommend sending the commands from the the s71200 to the Nextion IDE in debug. You will be able to see the format the commands come in. this will allow a better view.

    • @manuelrodriguezlatorre8978
      @manuelrodriguezlatorre8978 Рік тому

      @@CheapControls I have already done it, I have replaced the nextion screen with a FR232RL and connected to the serial port of the computer and apparently all I receive through the port is 28 bytes approximately all 0

    • @CheapControls
      @CheapControls  Рік тому

      You might want to skip the IDE and attach it to Hterm. this program allows you analyze the data on the serial port down to the bit level. It is a available at the der-hammer website. I have found it very useful for trouble shooting these types of issues. I wish I could help more but without access to a s71200 it is difficult to see what is going on.

  • @hopje01
    @hopje01 3 роки тому +1

    At 11min, line 49, and 26min line 90: I think & must be && (logical and, not a bitwise and)

    • @CheapControls
      @CheapControls  3 роки тому

      Thanks for the feedback and thanks for watching

  • @budipurnomo5955
    @budipurnomo5955 3 роки тому

    i cant verify the dfd in serial monitor why

    • @budipurnomo5955
      @budipurnomo5955 3 роки тому

      #include
      String endchar = String(char(0xff)) + String (char(0xff)) + String(char(0xff));
      unsigned long asyncDelay = 0; // note 4,294,967,295
      int delaylenght = 500;
      String dfd ="";
      union {
      char charByte[4];// character
      long valLong; // integer
      } value;
      void setup() {
      // put your setup code here, to run once:
      Serial2.begin(9600);
      Serial.begin(9600);
      pinMode(13,OUTPUT);
      }
      void loop() {
      // put your main code here, to run repeatedly:
      if (Serial.available());{
      dfd +=char(Serial.read());
      }
      if(dfd.length()>15) dfd="";
      if((dfd.substring(0,3)=="val") & (dfd.length()==15)){
      Serial.println(dfd);
      value.charByte[0] = char(dfd[3]);
      value.charByte[1] = char(dfd[4]);
      value.charByte[2] = char(dfd[5]);
      value.charByte[3] = char(dfd[6]);
      Serial.println(String(value.valLong));
      dfd="";
      }
      if(millis()> asyncDelay + delaylenght){
      if(asyncDelay > (4294967295-delaylenght)){
      asyncDelay = (4294967295-delaylenght) + (delaylenght-(4294967295- asyncDelay ));
      }
      else {
      asyncDelay+=delaylenght;
      }
      digitalWrite(13,!(digitalRead(13)));
      }
      if (dfd.endsWith(endchar)){
      Serial.println(dfd);
      Serial.println("error");
      dfd = "";
      }
      }
      use mega2560

    • @CheapControls
      @CheapControls  3 роки тому

      Are you using Serial2 to connect to the Nextion? If so you need to change the following
      if (Serial2.available());{// NOTE : Serial to Serial2
      dfd +=char(Serial2.read());// NOTE : Serial to Serial2
      // NOTE : add the following to test that you are getting characters
      Serial.println(dfd);
      }
      If you send "Hello" from the nextion it will appear on the Seral monitor like this
      H
      He
      Hel
      Hell
      Hello

    • @budipurnomo5955
      @budipurnomo5955 3 роки тому

      @@CheapControls I try using PC, and serial2 connect to nextion hmi

    • @budipurnomo5955
      @budipurnomo5955 3 роки тому

      Using HMI editor

    • @CheapControls
      @CheapControls  3 роки тому

      In debug mode or physical display?

  • @marciooliveira8017
    @marciooliveira8017 4 роки тому +1

    Code please :)

    • @CheapControls
      @CheapControls  4 роки тому

      you can download the files here www.patreon.com/cheapcontrols

  • @nabs6160
    @nabs6160 4 роки тому

    Can i get your program arduino please

    • @CheapControls
      @CheapControls  4 роки тому

      you can download the files here www.patreon.com/cheapcontrols

    • @cred7445
      @cred7445 2 роки тому

      @@CheapControls not working any more

    • @CheapControls
      @CheapControls  2 роки тому

      @@cred7445 Are you referring to the link? I will update it in the description. I have moved the field to www.cheapcontrols.com You can search by video number. IF you don't see the files add a comment on the site and I will add them. I am in the process of updating the website and adding the files for the videos.

    • @cred7445
      @cred7445 2 роки тому

      @@CheapControls can you help me via dm instagram?

    • @CheapControls
      @CheapControls  2 роки тому

      @@cred7445 I don't do dm over Instagram. You can submit a comment on www.cheapcontrols.com, and I will respond with an email.