#101
Вставка
- Опубліковано 8 вер 2024
- This video is the 4th in a series showing to transfer float values from the Arduino to the Nextion. In this example, I transfer a sudo-float value from the Nextion to the Arduino reconfigure it and send it back to the Nextion
If you enjoy the content considering donating a cup of coffee at ko-fi.com/chea...
You can sort and find videos better on at www.cheapcontrols.com
I have started a group on Facebook to make it easier to interact with user-requested videos. Consider looking it up. www.facebook.c...
Awesome! I've made a keypad for entering a set of numbers to run some steppers. Really wanted to be able to include decimal points, but was unable to figure it out. This is exactly what I needed. I just started playing with the nextion screens and your channel has been an invaluable resource. Thanks so much.
I am glad I can help. I am on a break but will back to making tutorial videos in a month or two. Thanks for watching.
Thank you very much, your videos are very good, they have a lot of quality!
How can I use this variable on the arduino?
for example:
If I received a 1.1 from the nextion screen and wanted to save the value for later use in an if like this: "if (value == 1.1) {
digitalWrite (12,1);} "
I would think you could use it similar to your example. Do you think it would be useful to make a follow up video with a practical example?
@@CheapControls
Yes, that would be very illustrative, I understand the general idea of how to read and that opened many doors for other types of code. But I would like to see how you do it, your codes are much cleaner, and professional!
I was looking through some older comments and was wondering if I ever made a video that assisted you with this. I usually reply when I put out the video but I did not respond to you and I never want to leave people without a reply. I apologize if I was not able to assist you.
Very thanks
Most welcome
How will I send multiple float values(x1.val, x2.val, x3.val) from a single page by clicking a single button?
I will try and help through your Email request.
Congratulations on the excellent tutorial! What changes must be made to the code in order for it to run on ESP8266?
I am not that familiar with the ESP8266. I have played with it and I believe it has a Serial Port. I would think the only change would be in the configuration of that portion. Thank you for watching and have a wonderful day.
Hi Thank you for the great video content you provide. I need a way to change the text in t0.txt from Standby to Running from Arduino to Nextion, could you show me an example. Thank you
Also it would be great to be able to change this on multiple pages (a status bar on top, on all pages)
Watch this video and let me know if it helps. ua-cam.com/video/tQTrgLgYsZI/v-deo.html
Hi there, thanks a lot for the video. I have got one error while compiling. i.e. error invalid:Variables:send_value.txt
for send_value.txt="float"
send_value.txt+=decimal.txt
send_value.txt+=value.txt
print send_value.txt
do you have the for line for(send_value.txt=="float") -- note the double equals sign
@@CheapControls sorry for the typing mistake. I'm not using for
i have tried double equals to, but same error i'm getting i.e. Error:Invalid Variables:
send_value.txt (double click to jump to code)
send_value.txt(double click to jump to code)
send_value.txt(double click to jump to code)
send_value.txt(double click to jump to code)
I am still not following. If you go to cheap controls you can submit this as a comment and I will Email yo back then you can submit your code for review. If I see the HMI file it might help me follow you better. Sorry for following your request better.
@@zeptohassan6928 Check if your variables are declared as string
if there isnt come float, else { data_from_display="" } ??
I am sorry but I do not understand that comment. Will you please try to re-phrase?
Does this method work with multiple float values on the same page?
You could but you would have to have a unique identifier for each box. float1 and float2 or something like that and then check for that unique identifier in the Arduino.
at 8:30 you say note there is a cast to float. What does it mean ?
Before I answer that do you know the difference between a float and an integer. Sorry to ask but my answer will be different depending on if you know the difference or not.
@@CheapControls I think a float have decimal and intger have not. Im french so i try to translate what was a '"cast" but never got an answer. :) thank for reply !
I was waiting for your reply. to cast is to take a value, in this case an integer. If you want to keep it an integer for the code but for a single calculation you want to turn it into a float you can "cast" it. lets say you make x an integer. x = 10. Then x/4 would be equal to 2 instead of 2.5 but if you cast it like this float(x)/2 would temporarily turn it into a float just for this line of code.
cov x0.val,value.txt,0
cov x0.vvs1,decimal.txt,0
send_value.txt="float"
send_value+=decimal.txt
send_value+=value.txt
print send_value.txt
Why i get those errors?
Error:Invalid Variables:send_value( Double click to jump to code)
Error:Invalid Variables:send_value( Double click to jump to code)
Error:Compile failed! 2 Errors, 0 Warnings,
cov x0.val,value.txt,0
cov x0.vvs1,decimal.txt,0
send_value.txt="float"
send_value.txt+=decimal.txt// you need the ".txt"
send_value.txt+=value.txt// you need the ".txt"
print send_value.txt// I would also not use print but prints sendvalue.txt,0
I do not have the editor with me but I think mhy changes above are correct. I leave the .txt off all the time.
@@CheapControls I was reading the code for more than half hour i couldn't see that the .txt was missing. Thank you very much.
I am glad I was able to help. I have done the same. Spent hours because I forgot a comma or a semi-colon. It can be frustrating.
@@CheapControls Everything looks ok but if i change the value more than 2-3 times i get this at Serial monitor. And
19:44:21.457 -> DIVISOR - 100 Value = 45.85float2588
19:44:36.827 -> DIVISOR - 100 Value = 5.88f⸮oat2300
19:45:27.421 -> f⸮oat2300float2300
19:45:38.277 -> f⸮oat2300float2300f⸮oat2330
19:48:00.612 -> f⸮oat2300float2300f⸮oat2330fl⸮at2530
19:48:38.754 -> f⸮oat2300float2300f⸮oat2330fl⸮at2530float2530
It looks like it is getting appended with clearing
Hello, can the source code be shared? thanks
If you want source code you have to go to www.cheapcontrols.com and fill out the comment form. List the video number if you want the Arduino code or the Nextion code or both. Thank you for watching.
@@CheapControls I have made a comment, thank you for your wealth, the problem I am currently encountering is the conversion between ieee754 floating point numbers and four-byte hexadecimal numbers. Can you do a video to give pointers, thank you
Check out this video and see if it helps ua-cam.com/video/MhjV6xppNBU/v-deo.html