Тёмный

Nextion+Arduino Tutorial #2 Sending Data To Arduino 

InterlinkKnight
Подписаться 30 тыс.
Просмотров 271 тыс.
50% 1

I show a few examples on how you can send data from the Nextion display to the Arduino board and vice versa. This time I use the nextion library, but only to receive data from the display. To send data to the display I still prefer sending it without using the library (like I showed on my 1st tutorial), so this tutorial is a mix of both techniques.
Note: On the video I said "microseconds", but it's actually milliseconds.
- Buy the Nextion 3.5" Enhanced: amzn.to/3qMfjTd
- Buy Arduino nano: amzn.to/2Q4sA5h
Recommended Tools:
- Electronic Parts Tester (ESR LCR-T4): amzn.to/2QvQJlP
- Breadboard (good quality): amzn.to/2QsyY3C
- Storage Case for Jumper Wire: www.walmart.com/ip/The-Hillma...
- Multimeter (Fluke 17B+): amzn.to/2L3PNQk
- Rigol DS1054Z Digital Oscilloscope: amzn.to/2C5ZwD7
Note: As an Amazon Associate I earn from qualifying purchases.
Nextion+Arduino Tutorial #1 Beginner's Guide: • Nextion+Arduino Tutori...
Nextion+Arduino Tutorial #3 RTC and EEPROM (Enhanced Version): • Nextion+Arduino Tutori...
Nextion+Arduino Tutorial #4 Custom Gauge And Play Video: • Nextion+Arduino Tutori...
Nextion+Arduino Tutorial #5 Troubleshooting: • Nextion+Arduino Tutori...
Nextion+Arduino Tutorial #6 A Project From Scratch: • Nextion+Arduino Tutori...
My example nextion project file #2: drive.google.com/open?id=1srT...
My example arduino sketch file #2: drive.google.com/open?id=1HjA...
Nextion library (Original): github.com/itead/ITEADLIB_Ard...
Nextion library (My copy): drive.google.com/open?id=1e9v...
Nextion library configuration file for Arduino Uno/Nano: drive.google.com/open?id=1OTg...
You put this file on the "ITEADLIB_Arduino_Nextion-master" folder, that is on your library folder.
Quick Start Guide:
www.itead.cc/wiki/Nextion_Edi...
Nextion Instruction Set:
www.itead.cc/wiki/Nextion_Ins...
nextion.itead.cc/resource/doc...
FAQ:
What model is your display?
It's the 3.5" enhanced version NX4832K035.
Website: interlinkknight.wixsite.com/i...
Patreon: / interlinkknight

Наука

Опубликовано:

 

19 сен 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 606   
@beamertech1
@beamertech1 4 года назад
I’m remaking the check control display in my 1985 BMW 635CSi to look modern and impressive. I have a lot to do and am currently brainstorming workflow charting all of the processes before designing my screens in CorelDraw. I’ve made a few but it’s super challenging. I’ll be referring to your videos as I complete the build. Keep your videos coming. They’re a HUGE HELP and I’m very grateful.
@passelig
@passelig 4 года назад
REALLY well made video! I love the effort you have put into making it "to the point" and focusing on the difficult parts
@experimentboyTV
@experimentboyTV 5 лет назад
Thanks for the great video! However I'm having issues with a Teensy 3.6 and a Nextion 3.5". In one way I can send text info from the teensy to the display and change the text inside a button, but nothing happens whenever I press buttons I created... I've tried everything :(
@experimentboyTV
@experimentboyTV 5 лет назад
Found the issue, Serials 1 to 3 wouldn't work, I had to use Serial4 and set it in NexConfig.h too
@nguyennguyenoffical
@nguyennguyenoffical 3 года назад
@@experimentboyTV I have a problem with the button is not responding, I use nextion screen 3.2, can you help me?
@betoarango1772
@betoarango1772 6 лет назад
This clears up so many questions. Thank you very much for this video as well as the sample sketch.
@interlinkknight
@interlinkknight 6 лет назад
Enjoy.
@CleancutCampers
@CleancutCampers 5 лет назад
Thank you so much for this. I've been searching so hard for the information in this video. Keep up the good work.
@wonkastudio-1211
@wonkastudio-1211 6 лет назад
you are best so far in explaining the nextion displays.thank you for all your hard work and R&D. please make more videos !!
@interlinkknight
@interlinkknight 6 лет назад
My pleasure. So far the only video about the nextion display that I plan to make is comparing the basic version vs the enhanced. I can't think of any other thing to make a video about that I didn't talk about already. Do you have any other idea about more videos about the nextion display? I am working on other new videos, but they are not about the nextion display.
@emil.mammadov
@emil.mammadov 4 года назад
Man you saved my day with that Send Component ID thing. I appreciate you
@interlinkknight
@interlinkknight 4 года назад
:)
@REXONCROSS
@REXONCROSS 5 лет назад
Thanks a lot for your help mate. This is the perfect tutorial for all my questions.
@eligijuspranskunas3509
@eligijuspranskunas3509 4 года назад
your code inside with explanations is very good and clear, thanks a lot!
@matzs.5168
@matzs.5168 6 лет назад
Thanks for your Nextion tutorials!! Great Work!
@leeharrington6438
@leeharrington6438 6 лет назад
This has been a big big help - so many thanks for this!!
@interlinkknight
@interlinkknight 6 лет назад
I am glad. If you have any problem, let me know.
@alien4ufo364
@alien4ufo364 5 лет назад
Hi i'm wondering if this sketch run on your arduino cause when i upload the whole code it messages... C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp:203:1: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status compilation terminated. c:/program files/windowsapps/arduinollc.arduinoide_1.8.15.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed collect2.exe: error: ld returned 1 exit status exit status 1 Error compiling for board Arduino/Genuino Mega or Mega 2560.
@MyViewsOfCornwall
@MyViewsOfCornwall 5 лет назад
Many thanks, excellent presentation and commented coding. I hadn't figured out there is a PushCallback as I'd based my work on the CompButton example (uses just Pop) so I'd spent a couple of hours wondering why buttons only invoked the Arduino routine on release... So wish RU-vid had suggest your channel sooner before several others. Thank you again.
@interlinkknight
@interlinkknight 5 лет назад
That's great. I love helping. If you have a question about my examples let me know.
@ohmedarick1
@ohmedarick1 4 года назад
Thank you for your time and effort. Great video!!! Help me understand better the nextion library.
@Electromaniaworld
@Electromaniaworld 6 лет назад
sorry for non tech question, what software do you use for pc screen capture, i liked it when it zooms IN when you click at certain place on screen.
@interlinkknight
@interlinkknight 6 лет назад
I use nvidia shadowplay that it's included on GeForce Experience but the zoom is not made by the screen capture. I zoom manually using my video editor (Sony Vegas) much after I record/capture everything.
@becky3505
@becky3505 6 лет назад
Hiya, Thank you for taking the time to post the videos. I have a large RC project that include touch screen to control multiple distances on a single stepper.
@interlinkknight
@interlinkknight 6 лет назад
Sounds nice. Do you have a video showing your project?
@ivandaniel9535
@ivandaniel9535 4 года назад
Thank you for your video, it has opened the door for me with the nextion display. My project is a multi screen EFIS for my Light Sports Aircraft (2 seater). The plan is two 3.5 inch displays and a 7 inch. The micro computer/s are ESP32. Will keep you updated as the system progresses. thanks again
@interlinkknight
@interlinkknight 4 года назад
Your project sounds awesome. Yes, please keep me inform about your project. My email is on my channel page
@checiui5736
@checiui5736 2 года назад
Salut Ivan, dacă ești disponibil și dispus as vrea să-ți adresez niște întrebări despre cum as putea face un ecran EFIS prin intermediul arduino și nextion, mi se pare foarte interesant și m-ar ajuta foarte mult dacă ai vedea acest mesaj, mulțumesc anticipat!!
@lanfrancosimoncelli3980
@lanfrancosimoncelli3980 5 лет назад
Finally someone who puts the sketch to help and not just a movie to show that it is cool Thank you
@omribarkan170
@omribarkan170 5 лет назад
Hi, Can you share the sketch ?
@lanfrancosimoncelli3980
@lanfrancosimoncelli3980 5 лет назад
@@omribarkan170 Hi Omri, My project is opensource, you can find all information in this forum: www.psktrentunisti.it/psk/forum/7-autocostruzione/959-sostituzione-controller-yaesu-con-display-nextion.html?limitstart=0 The new video is here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JVZOkg2VBbw.html
@NikolayAgopyan
@NikolayAgopyan 6 лет назад
Thank you for the great tutorial, answered LOTS of questions!
@interlinkknight
@interlinkknight 6 лет назад
I am glad it helped. Cheers.
@glynnmason8205
@glynnmason8205 6 лет назад
I like this display it makes displaying different things easy good video you have done
@sebastianm7894
@sebastianm7894 5 лет назад
Thank you my friend! You form Beginners to Amateurs.
@aialik29
@aialik29 4 года назад
You are so right about not using the Nextion library to send to the display. I had everything coded correctly using the library but the Nextion was not responding reliably. So I changed to sending data to Nextion using the plain simple print/write statements like you say to use. When I do that everything works right. Thanks.
@interlinkknight
@interlinkknight 4 года назад
I'm glad i could help
@robertsatoer4668
@robertsatoer4668 5 лет назад
seriously great vids to get me started. hope I will debug all the typo's before i get sick of it ;)
@gr7480
@gr7480 6 лет назад
Thanks from Spain, good tutorial, very complet.
@claybeard1
@claybeard1 6 лет назад
very clear explanation, great detail in the arduino file, many thanks for this upload!
@interlinkknight
@interlinkknight 6 лет назад
:)
@SuperADI2
@SuperADI2 6 лет назад
You are very good in explaining and presentation I like it, Great job :)
@interlinkknight
@interlinkknight 6 лет назад
Thank you. I really apreciated.
@sirthomas2591
@sirthomas2591 4 года назад
You were sent from coding heaven. Thanks a million. Now I have a chance. Thats a lot of work you've saved me.
@frettedheart
@frettedheart Год назад
Absolutely perfect! Thank you very much for sharing the details of your code.
@interlinkknight
@interlinkknight Год назад
I'm glad I could help
@jarno4054
@jarno4054 6 лет назад
Very nice video, very good explaned and the instructions are very clear, thanks!
@interlinkknight
@interlinkknight 6 лет назад
:)
@MrJordinhand
@MrJordinhand 5 лет назад
Thanks for the video, great help!!!!
@AndreAnaPena
@AndreAnaPena 5 лет назад
Just what I was looking for! Thanks so much!!!
@interlinkknight
@interlinkknight 5 лет назад
You're welcome
@jeromedormoy3932
@jeromedormoy3932 6 лет назад
Thank you ! That was very helpful !
@TheOleHermit
@TheOleHermit 2 года назад
Thank you for doing this Nextion tutorial series. I plan to use the Intelligence model as 2 dimensional 'slider' to control X & Y gains of a laser controller. IOW, sliding from bottom left to upper right increases both X & Y. Sliding in a circle changes the symmetry of quadrature waveform pairs or the overall image. Of course, a dot will be required to indicate the current position, as well. I've never seen any similar HIDs on any other controllers, but it is much needed in laser controllers to combine two x & y sliders (requiring 2 hands) into a single touch pad (requiring only one finger). There are never enough hands for a single laserist to keep up with a 4 piece band nor orchestra in real time.
@interlinkknight
@interlinkknight 2 года назад
That sounds really cool. If you can, post a link of a video showing that project. I would love to see that
@TheOleHermit
@TheOleHermit 2 года назад
@@interlinkknight Yeah, me too. Lots of R&D ahead, but that's part of the challenge, isn't it? Just hit snag with my Teensy's audio DACs being capacitor coupled, so they filter out DC offests, like beam positions and DC color control. 🤔 This project could take months to complete, assuming that everything works like it's supposed to. Shoot for the stars and wear a parachute, right?😎
@interlinkknight
@interlinkknight 2 года назад
Totally! Good luck
@marcelomacedo1022
@marcelomacedo1022 2 года назад
Congratulations on the excellent tutorial.
@deeptibaviskar6456
@deeptibaviskar6456 3 года назад
Thank you for the excellent learning video. Helped me a lot.
@interlinkknight
@interlinkknight 3 года назад
I'm glad
@rishisoni1782
@rishisoni1782 Год назад
This was very helpful. Thank you.
@imabozoMeng
@imabozoMeng 10 месяцев назад
Fantastic video, man! Thank you 👌
@elricho72
@elricho72 6 лет назад
Thanks for yours videos !!!
@interlinkknight
@interlinkknight 6 лет назад
It makes me happy to help. So, my pleasure.
@captainspongeboy
@captainspongeboy 6 лет назад
You are a superhero! Thank you
@schneebrett903
@schneebrett903 3 года назад
Thanks for the tutorial. It was very helpful. I just needed to figure out why it didn't work. So I ended up downloading a few files with bug fixes by Ray Livingston (NexConfig.h, NexHardware.cpp and Nexhardware.h). But the main culprit in my case was probably the fact that I had Arduino Nano connected to the USB while using the RX0 and TX1 pins for serial communication. After disconnecting the USB and resetting the Arduino it suddenly worked! Before that I always had a get.value error (or time-out after using Livingston's bug fixed files). Now I can use a dual-state button for motor on/off and a slider to regulate RPMs through a motor driver with PWM. Project: I am designing a touch screen MMI for a cosmetic machine.
@rachelchow4512
@rachelchow4512 3 года назад
so will you consider to look at touch screen display?
@andrewpepper1
@andrewpepper1 6 лет назад
Thanks Thanks Thanks !!! Fantastic clear simple step by step explanation again Thanks
@interlinkknight
@interlinkknight 6 лет назад
I am glad you find it useful. Cheers
@jamescullins2709
@jamescullins2709 6 лет назад
very interesting video, I have learned a lot form it.
@interlinkknight
@interlinkknight 6 лет назад
:D
@atmk
@atmk 6 лет назад
super helpful, Thank you
@renatocanhaify
@renatocanhaify 5 лет назад
Thanks for your work. I have a question: is it possible to make an xy plot with online data from arduinto. Let me explain: I am buiding an potensiostat, a devide which imposes a triangular potential ramp perturbation o an electrochemical system (batery for example) and record the current flowing between electrodes. I need to plot current in y axis and potential on x axis. Thank you.
@interlinkknight
@interlinkknight 5 лет назад
The nextion display does support wave form that is similar to a xy plot. Is it enough? There's no native way to have a xy plot, but I imagine it could be done with some tricks and hard work. You know, maybe creating a matrix of square images and control each one as pixels. But not easy. If all you need is a simple xy plot, a conventional display would be better because you can control the pixels more directly and that way you have more freedom. The nexiton display is more for complex stuff that can't be done by arduino directly.
@anh6790
@anh6790 4 года назад
Great! Thanks for sharing to the world @@!
@cedricbron7472
@cedricbron7472 5 лет назад
Thanks a lot...amazing job...
@naveenshetty2891
@naveenshetty2891 6 лет назад
Instead of putting the code bauds=115200 in arduino code , can i have it set as a pre-initialization in nextion
@drawingboard82
@drawingboard82 6 лет назад
Thanks very much, you are a godsend. I like the display but there is so little useful information on how to use it. I am using mine as a display for an electric outboard motor for a small boat.
@interlinkknight
@interlinkknight 6 лет назад
I am glad I could help. If you have a video or pictures of your project, leave the links here.
@RoMecha_lb
@RoMecha_lb 3 года назад
hello again , i have one more question , if i want to read multiple texts from the nextion display, i cannot read more than one text , i tried multiple things like create a new character "char buzzer2" for example , it only gives me on arduino monitor one text(buzzer or buzzer1) only, do you have any suggestion that can help me sir Thank you
@charlesfernands
@charlesfernands 3 года назад
thank you very very very much bro!!!! your video saved me!
@interlinkknight
@interlinkknight 3 года назад
I'm glad. You're welcome
@drakkorvladimir4012
@drakkorvladimir4012 5 лет назад
Awesome! Thank You.
@twin331000
@twin331000 5 лет назад
Hi I tred your example, but i got an error on : nexLoop(nex_listen_list); exit status 1 expected constructor, destructor, or type conversion before '(' token can you tell whats wrong
@interlinkknight
@interlinkknight 5 лет назад
I never seen that error. Watch my troubleshooting video.
@idoumlatifa8520
@idoumlatifa8520 5 лет назад
hi thanks for your video it's really helpfull. I didn't anderstand why we have to use 0xff to show messages in nextion. Thanks again for the video and for help
@interlinkknight
@interlinkknight 5 лет назад
I am glad you like it. Those 3 lines of "0xff" basically tells the display that is the end of the command. That's why you need it.
@omribarkan170
@omribarkan170 5 лет назад
Hi, First, I want to thank you for your very nice and clear example. It taught me a lot of things. And second, I have a few quetions: 1. In your example, you've changed the value in page 2, box "n0" between 0 and 1, by pushing butten "c0" (number3) but I didn't see where do you change the value of "number3". 2. How can I use softwareSerial in this example ("SoftwareSerial HMISerial(10, 11);" ? 3. If I want to play with this example, and follow the values, how can I do this, or in different words, how can I debug the sketch? 4. Where can I find the command list for Nextion, like " c0.getValue(&number3)", "Serial.print(number3)".......etc. Thanks, Omri
@interlinkknight
@interlinkknight 5 лет назад
I am glad you like the video. To answer your questions: 1. In page2 object n0 is showing the page number between 1 and 3. That's sent by arduino. 2. I don't recommend using software serial with the nextion library. It doesn't work well. The only way the software serial works with the nextion display is if you want to only send data to the display, and you can do it normally as you would with any other serial device. 3. I don't understand the question. 4. I don't understand the question.
@althuelectronics5158
@althuelectronics5158 4 года назад
After editing and looking to upload, on the Adino board but not upload error. Please helping sir
@TheFlybyman
@TheFlybyman 5 лет назад
Will you make more videos about this ? Ill like to control some neopixel, and make pattons and color, when push bottons. And i can get it to work :)
@interlinkknight
@interlinkknight 5 лет назад
I feel that I already showed everything relevant to show about the nextion display.
@patrickvalk
@patrickvalk 5 лет назад
Amazing sound improvement !!
@interlinkknight
@interlinkknight 5 лет назад
Thanks. Yeah, I got a new mic.
@patrickvalk
@patrickvalk 5 лет назад
@@interlinkknight really liked your videos, but with the new mic it's just so much better :)
@bobpaydar
@bobpaydar 3 года назад
thanks for very good tutorial 👍🏻🌹
@rachelchow4512
@rachelchow4512 3 года назад
Hi bob will you consider to use some other brand touchscreen display?
@MRgamer-gg6in
@MRgamer-gg6in Месяц назад
Thanks Really Helped
@atngo5599
@atngo5599 6 лет назад
I bought a HMI China. I couldn't use CallBack function in Nextion library. Dosen't it support for this HMI display? Thank for your attention!
@interlinkknight
@interlinkknight 6 лет назад
I am not sure what kind of display you bought but this tutorial is for the nextion display only.
@TheFlybyman
@TheFlybyman 5 лет назад
WHY ? Nextion_Tutorial1_c:65:5: error: 'bt2' was not declared in this scope + 'NexDSButton' does not name a type
@interlinkknight
@interlinkknight 5 лет назад
you are using the wrong library
@TheFlybyman
@TheFlybyman 5 лет назад
@@interlinkknight Thanks ! :) GOOD WORK!
@wenzhuoyili4781
@wenzhuoyili4781 5 лет назад
@@interlinkknight I have the same problem, but I checked my library is correct apparently? pls help.
@interlinkknight
@interlinkknight 5 лет назад
Watch my troubleshooting video
@eduardoantunes7374
@eduardoantunes7374 4 года назад
Hello, I have one, and as I can se it's use serial comunication, did tou declare de pins for the comunication on Arduino ? I didn't see this on your code.
@interlinkknight
@interlinkknight 4 года назад
In arduino uno and nano there's only one serial port. Nothing to declare there
@muralisubramaniam5622
@muralisubramaniam5622 4 года назад
LIke Thomas said.. you were sent by coding heaven. I do have some problems though when I interface with STM32 nucleo. Working on it...:)
@wonkastudio-1211
@wonkastudio-1211 6 лет назад
also would like to know, can you only write to the page that is currently displaying? if you write data to a non displayed page , will data be retained ?
@interlinkknight
@interlinkknight 6 лет назад
The only object that it can receive data without being on the current page is the global variable, at least that I can think of. All the rest have to be on the current page. But why do you care about sending data to objects in other pages? What is the thing that you are trying to do?
@alien4ufo364
@alien4ufo364 5 лет назад
some sources write the library like this #include "nextion.h" instead of or NexDSButton bt0 = NexDSButton(0, 2, "bt0"); what is DS?
@interlinkknight
@interlinkknight 5 лет назад
DS = Double State. It's one type of button in nextion when you press is ON and when you press again is OFF. The "nextion.h" vs doesn't matter. I can only help you if you stay focus on my examples. If you get information for any other source, I have no idea what you are doing so no way I can help you. And if you need to write and write a lot, better send me an email.
@alien4ufo364
@alien4ufo364 5 лет назад
Yes Please i'll appreciate if you give me your Email address...
@mrk2028
@mrk2028 Год назад
Thank for your video. I think there is a problem with "nexLoop(nex_listen_list); // Check for any touch event". popmenus does not work or never. ..
@adeekhan3463
@adeekhan3463 6 лет назад
Brother i am using Nextion to send command to arduino to run the stepper and control relays. i have buttons for their control... do i have to mention all pages in arduino code??? because i have done everything mentioned in your code except mentioning pages.... will be really thankful if you help
@interlinkknight
@interlinkknight 6 лет назад
As I mentioned on the video, I let arduino know what page the display is on to avoid arduino sending data to non-existing objects. If you are not sending data to the display, then you don't need this. If you do send data to the display, then you might notes some slowdown on the arduino loop because the display would be sending a constant error message. The problem is that if you send data to the display and that object doesn't exist on the current page, the display will send an error message and arduino will listen to that. This slows down the loop and will create some lag.
@THECAPTAIN-ev7bj
@THECAPTAIN-ev7bj 4 года назад
Best tutorial
@mucasa
@mucasa 4 года назад
Dear, Can you help me again? I have "Number BOX" with Number Keypad in the Nextion. I need to get the value to a "int" in arduino... Do you know ? Tks a lot.
@interlinkknight
@interlinkknight 4 года назад
I showed on this video how to do that
@stevekimanthi9582
@stevekimanthi9582 6 лет назад
Hi, is it possible to change the state of a dual state button on the display with an external dual state button connected to the arduino? I want to control a light with both buttons so when i physically press the button connected to the arduino the button on the nextion should go to the same state as the physical button.
@interlinkknight
@interlinkknight 6 лет назад
Of course you can. Just send the value to the button like anything else. Example: bt0.val=1 to press or bt0.val=0 to release. Obviously send also the 3 finishing lines as always. See my examples.
@razvandinica7705
@razvandinica7705 6 лет назад
Thanks for the great videos. Very clear to understand how to comunicate with Nextion displays. I still have an issue with getting data from the display. Not receiving the value with the get command. I am using software serial on Arduino Pro Mini " SoftwareSerial HMISerial(2,3) ". The receiving variable remains zero ( or the value what is given on the initialization ). Any ideea why this is happening ?
@interlinkknight
@interlinkknight 6 лет назад
I tested software serial with the nextion display too and I got problems receiving data too. Solution: don't use software serial, unless is to only send data to the display.
@superisaac3303
@superisaac3303 2 года назад
so when i plug in the nextion to my computer, and launch into the game, the nextion doesnt receive and data from the game, any clues why this has happened?
@thenderick7434
@thenderick7434 2 года назад
I tried to use your same program of arduino and nextion on my display and i can receive information but i cant send information to arduino, do you have any idea of what is this happening?
@turbo2ltr
@turbo2ltr 4 года назад
I want to make a quad state button. I put the code in to rotate through the 4 different images. Is there a way to send back the PICC of an button? Knowing that it was pressed doesn't do me any good if I don't know what image it's currently showing.
@interlinkknight
@interlinkknight 4 года назад
You can't know directly, but you could do it storing the state of the button in a variable inside the nextion display. You can later read that variable from arduino.
@turbo2ltr
@turbo2ltr 4 года назад
@@interlinkknight Thank you! I assume I can instead just have a regular button (or crop?) have it send the touch event and let the microcontroller manage the button state and push the correct picc for the crop area back to the display correct? I don't want to have to poll for changes.
@interlinkknight
@interlinkknight 4 года назад
Yeah, that's even better. Let arduino keep the state of the button and you just change the picture with arduino
@igeorge688
@igeorge688 6 лет назад
What is the tiny Arduino you use on the video, part number and where to buy. Thank you
@interlinkknight
@interlinkknight 6 лет назад
It's called arduino nano. It's very common. It uses the same code as arduino uno. I like it because is small, can be plugged into a breadboard and it's super cheap from china (US $3). I buy them on ebay, usually 10pcs at a time
@georgbrunhuber2329
@georgbrunhuber2329 5 лет назад
Hello, maybe you can help me. I want to build a small filling station. It stumbled on deas Nextion Display that pleases with a lot. Is this possible with an Arduion Uno HX711 and a stepper motor. How should I tackle the project am new to the field but know something about programming. Maybe you can help me there. mfg George
@interlinkknight
@interlinkknight 5 лет назад
Start trying my examples and go from there.
@eligijuspranskunas3509
@eligijuspranskunas3509 4 года назад
Hi, great tutorial, but I'm stuck on my project, How to send variable from Nextion to arduino bigger than 255? for ex.: variable1.val=450 i need to get that number in to my arduino sketch (int var1) variable.
@interlinkknight
@interlinkknight 4 года назад
I don't know
@user-xm5gy8tp9y
@user-xm5gy8tp9y 4 года назад
Thank you for good example. But i have a problem. I wonder why i coudn't use getText or getValue function. My nextion library is ITEADLIB_Arduino_Nextion-0.7.0. I changed library version but it didn't work. If you know how to get it work, could you tell me what i have to do?
@interlinkknight
@interlinkknight 4 года назад
You tried my example, right? Are saying that my example works except the text?
@naveenshetty2891
@naveenshetty2891 6 лет назад
hi, finally i was able to make it work, instead of putting in the arduino code, i put it under nextion pre-initialization section ( bauds= 115200).
@interlinkknight
@interlinkknight 6 лет назад
Some how the display was not receiving the baud change command. Now that you successful change the default baud rate of the display, you can now remove that code out of the pre-initialization.
@naveenshetty2891
@naveenshetty2891 6 лет назад
Thanks Buddy , will do that
@interlinkknight
@interlinkknight 6 лет назад
What compiler you where using when you had this problem? I know you solve it bu I really want to know what cause the problem.
@naveenshetty2891
@naveenshetty2891 6 лет назад
HI, U mean arduino version? it was 1.8
@interlinkknight
@interlinkknight 6 лет назад
Ok, thanks.
@simplyishan06
@simplyishan06 3 года назад
I have a text box where i punch in text on display using the alphanumeric keypad... When i press OK on that keypad, i wish to receive that text to my arduino mega rather than using a separate button to transmit that text... Could you help me with that?
@interlinkknight
@interlinkknight 3 года назад
I don't understand. Just make the OK button to send the text, like in my example
@werdy64
@werdy64 5 лет назад
Hi. In case any problem with Nextion.h library you can send and receive data from any platform of Arduino to Nextion desply. String incStr; //temporary receiving string void setup() { Serial.begin(9600); } void loop() { //continuously listening, receiving, combining and writing to incStr if (Serial.available()) { char inc; inc = Serial.read(); incStr += inc; if (inc == 0x0A) {// in case "CR" applying to AnalyseString(incStr) AnalyseString(incStr); incStr = "";//at the loop end temporary incString to be empty } } } void AnalyseString(String incStr) { if (incStr.indexOf("xxxx") >= 0) {//event provided the lcd has sent "xxxx" //do something for event xxxx } if (incStr.indexOf("yyyy") >= 0) {//event provided the lcd has sent "yyyy" //do something for event yyyy } } /* In the lcd Nextion to be code for event "xxxx" print "xxxx" printh 0d 0a for event "yyyy" print "yyyy" printh 0d 0a 0a - means "CR" or carriage return */ /* If you wanna to send something to lcd pls use the followed construction for text ... SendData("t0.txt", "+1")//"t0.txt" and "+1" for example only ... void SendData(String dev, String data)//where dev - is object name of Nextion lcd; data - text to be send to this object { Serial.print(dev); Serial.print("="); Serial.print("\"");//in order to send to text field of the Nextion lcd double quota is obligatory before and after text to be sent Serial.print(data); Serial.print("\""); Serial.write(0xff);//obligatory triple 0xff at the and of this construction for Nextion lcd Serial.write(0xff); Serial.write(0xff); } */ /* if you wanna send number to the number field of the Nextion lcd double quota DOES'N be used and "String data" to changed -> int or something else */
@elricho72
@elricho72 6 лет назад
I have problems when i change the page if in the page is the same variable even though i check the current page sometimes work fine sometimes don't. I put the same code in my application printh 65 01 00 01 FF FF FF // [65] [PAGE_NUMBER] [00] [01] [FF] [FF] [FF] changing de page 00 01 02 in every case and check de page in my arduino code, but don't always work. Could you make something else? Other thing is i have a dual button and in the screen change well, but arduino is like sometimes like lose the data, because not respond always, is normal that?
@interlinkknight
@interlinkknight 6 лет назад
I am not sure I understand. I would have to check the sketch and nextion project to better understand the problem. But all that you mention appears to me as a problem in communication from the display to arduino. In my tests I never seen that, in normal situations. I can provoque communication problems using software serial, causing errors messages from the display, etc. But in normal situations, I never seen that level of inconsistency. My example files work well for you, right? Send me an email with the files and more details about the problem. My email address is the same as my youtube channel name at gmail.com
@korbano
@korbano 5 лет назад
I have a textbox on the Nextion and I need to get the value of the textbox as a String on the Arduino. It looks like the code for this video uses: memset(buffer, 0, sizeof(buffer)); t0.getText(buffer, sizeof(buffer)); But when I do Serial.println(buffer); it prints out [1296:1,14,b11] recvRetString[0,] How do I get it to print the value of the textbox?
@interlinkknight
@interlinkknight 5 лет назад
I already show how to do what you asked in minute 8:50
@korbano
@korbano 5 лет назад
@@interlinkknight that shows how to get the text to the arduino and then back onto the nextion, but I was looking for how to get that text into an integer on the nextion. The following worked: String inString = buffer; number = inString.toInt();
@interlinkknight
@interlinkknight 5 лет назад
Oh. Good to know.
@andpanca2759
@andpanca2759 3 года назад
why can't I run the getText function? even though other functions can be executed, do you have a solution?
@rachelchow4512
@rachelchow4512 3 года назад
will you consider to look at other brand touchscreen display?
@unauthorisedname
@unauthorisedname 2 года назад
It has been a while since you posted the video, I not sure if someone else have already commented something about the soft serial problem or if you have solved it, but, just to share the information, the problem probably was the baudrate, I was never able to make it go faster than 57600 using those atmega328 boards running at 16MHz.
@interlinkknight
@interlinkknight 2 года назад
I didn't know. Good tip. If you try it with the nextion display and it works, let me know
@DanielG0922
@DanielG0922 6 лет назад
Thanks a bunch!
@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.
@interlinkknight
@interlinkknight Год назад
First I suggest trying to run my example files in my first tutorial using an Arduino nano or uno. Don't do anything else until you have that working
@mrk2028
@mrk2028 Год назад
I could not simulate in proteus and nextion and virtual comm and ardunio... nextion sends data but ardunio can not send any dat to nexiton. Ithink pop push sub programs ca not be triggered by nexLoop (....) etc.
@edgaromarreynatorres3940
@edgaromarreynatorres3940 6 лет назад
I want to send a númeric value from nextion to my arduino for setting my pwm output How can i send this numeric value to my arduino
@interlinkknight
@interlinkknight 6 лет назад
I explained just that in my video. Try my example files.
@sanches2
@sanches2 2 года назад
Thank you!
@przemek_kw
@przemek_kw Год назад
Hi, I want to go into Arduino with nexrion display in my very first project, is it possible to connect this display with Arduino on much longer wires, ex 4-5 meters? Can I use for that shielded twisted pair wire? Will it work?
@interlinkknight
@interlinkknight Год назад
I don't know, but I think it should work. Try it out and let me know
@joescopo8933
@joescopo8933 4 года назад
Can I use software serial 2,3 on the Nano with the nextion, instead of the hardware serial 0,1?
@interlinkknight
@interlinkknight 4 года назад
Works for sending data from arduino to the display, but doesn't work well when receiving data from the display
@McuPro
@McuPro 4 года назад
Thank you very much.
@varunsam9947
@varunsam9947 4 года назад
I'm using a capacitive water level sensor.. once the water is empty the sensor detects and it should display "fill water" is this possible? Can you give me a clue? Please
@interlinkknight
@interlinkknight 4 года назад
Yes, it's possible. Use my example files as a guide
@RoMecha_lb
@RoMecha_lb 3 года назад
Hello , How are you today 😀, i have one question and i hope you will help me , when i compile the code , it gives me an error (NexButton' does not name a type; did you mean 'Nextion') do you have any suggestion to solve this issues?😢 I will be very grateful to you if you help me ✋ thank you .
@interlinkknight
@interlinkknight 3 года назад
Watch my troubleshooting video
@johnbabu3640
@johnbabu3640 5 лет назад
Very nice tutorial for the beginners. Can you please do a standalone GRBL controller using Mega ,since it has two serial ports. Nothing fancy but I am sire you can make it though. Thanks
@interlinkknight
@interlinkknight 5 лет назад
Sorry but I'm too busy with my projects.
@stahelpeter
@stahelpeter 6 лет назад
Hello, many thanks for your video and helped me a lot. I try to to identify the button / dual state button which is pressed on the display and use the getValue function. I get this error "MySensorNextion:254: error: 'class NexButton' has no member named 'getValue' bt0.getValue(&number1);". Any idea what the issue could be?
@interlinkknight
@interlinkknight 6 лет назад
I see the problem. In the first main section where we declare the objects you put NexButton instead of NexDSButton. NexButton is for normal buttons and you are trying to read a dual state button. Dual state buttons are called NexDSButton in this section.
@stahelpeter
@stahelpeter 6 лет назад
Thank you for the reply I know now what to do :-). I use the github.com/itead/ITEADLIB_Arduino_Nextion/archive/v0.7.0.zip library which does not include the DS button .h file. Are you working with the github.com/itead/ITEADLIB_Arduino_Nextion/archive/master.zip. libraray? (which das the DS button .h file)
@interlinkknight
@interlinkknight 6 лет назад
The link for the library I used is on the description
@marvg7062
@marvg7062 4 года назад
This is incredibly helpful, for some reason my slider is only sending the PWM value on Release even though I added the line of code printh 65 00 04 00 FF FF FF on the Touch Move.. any idea what I could do to get the brightness of my LED smooth instead of only refreshing after I release the touchscreen?
@interlinkknight
@interlinkknight 4 года назад
My only suggestion is to try my example and compare it with your code so you can see what you did differently
@electricbit
@electricbit 5 лет назад
thanks for helping me to understand, how nextion can communicate with arduino,
@interlinkknight
@interlinkknight 5 лет назад
I'm glad
@naveenshetty2891
@naveenshetty2891 6 лет назад
HI, I tried in three different ways, am not sure where i am going wrong, every try i switch off the both devices First Try( It communicates - Led turns on) Serial.begin(9600); delay(500); //Serial.print("baud=115200"); Serial.write(0xff);Serial.write(0xff);Serial.write(0xff); //Serial.end(); //Serial.begin(115200); Second Try Serial.begin(9600); delay(500); Serial.print("bauds=115200"); Serial.write(0xff);Serial.write(0xff);Serial.write(0xff); Serial.end(); Serial.begin(115200); switch the power off and then conneted , led does not turn on Third try Serial.begin(9600); delay(500); Serial.print("baud=115200"); Serial.write(0xff);Serial.write(0xff);Serial.write(0xff); Serial.end(); Serial.begin(115200); switch the power off and then conneted , led does not turn on
@ser7ser7i
@ser7ser7i 3 года назад
Thank you
Далее
NOOOOO 😂😂😂
00:15
Просмотров 6 млн
HYDRAULIC PRESS VS ARMOR, USA AND RUSSIA
10:16
Просмотров 615 тыс.
Nextion+Arduino Tutorial #6 A Project From Scratch
29:08
#engineering #diy #amazing #electronic #fyp
0:59
Просмотров 2,4 млн