Nextion+Arduino Tutorial #2 Sending Data To Arduino
Вставка
- Опубліковано 19 вер 2017
- 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 - Наука та технологія
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.
REALLY well made video! I love the effort you have put into making it "to the point" and focusing on the difficult parts
Thank you so much for this. I've been searching so hard for the information in this video. Keep up the good work.
you are best so far in explaining the nextion displays.thank you for all your hard work and R&D. please make more videos !!
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.
Man you saved my day with that Send Component ID thing. I appreciate you
:)
This clears up so many questions. Thank you very much for this video as well as the sample sketch.
Enjoy.
Thanks for your Nextion tutorials!! Great Work!
Thanks a lot for your help mate. This is the perfect tutorial for all my questions.
your code inside with explanations is very good and clear, thanks a lot!
This has been a big big help - so many thanks for this!!
I am glad. If you have any problem, let me know.
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.
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 UA-cam had suggest your channel sooner before several others. Thank you again.
That's great. I love helping. If you have a question about my examples let me know.
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.
Sounds nice. Do you have a video showing your project?
Thank you for your time and effort. Great video!!! Help me understand better the nextion library.
Finally someone who puts the sketch to help and not just a movie to show that it is cool
Thank you
Hi,
Can you share the sketch ?
@@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: ua-cam.com/video/JVZOkg2VBbw/v-deo.html
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
Your project sounds awesome. Yes, please keep me inform about your project. My email is on my channel page
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!!
Thank you for the great tutorial, answered LOTS of questions!
I am glad it helped. Cheers.
You were sent from coding heaven. Thanks a million. Now I have a chance. Thats a lot of work you've saved me.
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.
I'm glad i could help
Thank you my friend! You form Beginners to Amateurs.
I like this display it makes displaying different things easy good video you have done
Thanks from Spain, good tutorial, very complet.
Just what I was looking for! Thanks so much!!!
You're welcome
very clear explanation, great detail in the arduino file, many thanks for this upload!
:)
Congratulations on the excellent tutorial.
Absolutely perfect! Thank you very much for sharing the details of your code.
I'm glad I could help
Thanks for the video, great help!!!!
seriously great vids to get me started. hope I will debug all the typo's before i get sick of it ;)
Very nice video, very good explaned and the instructions are very clear, thanks!
:)
You are very good in explaining and presentation I like it, Great job :)
Thank you. I really apreciated.
Fantastic video, man! Thank you 👌
Thank you ! That was very helpful !
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.
That sounds really cool. If you can, post a link of a video showing that project. I would love to see that
@@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?😎
Totally! Good luck
This was very helpful.
Thank you.
Thank you for the excellent learning video. Helped me a lot.
I'm glad
You are a superhero! Thank you
Thanks for yours videos !!!
It makes me happy to help. So, my pleasure.
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.
so will you consider to look at touch screen display?
Thanks Thanks Thanks !!! Fantastic clear simple step by step explanation again Thanks
I am glad you find it useful. Cheers
thank you very very very much bro!!!!
your video saved me!
I'm glad. You're welcome
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.
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.
super helpful, Thank you
Great! Thanks for sharing to the world @@!
Thanks a lot...amazing job...
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.
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.
Amazing sound improvement !!
Thanks. Yeah, I got a new mic.
@@interlinkknight really liked your videos, but with the new mic it's just so much better :)
Awesome! Thank You.
very interesting video, I have learned a lot form it.
:D
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 ?
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?
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
After editing and looking to upload, on the Adino board but not upload error.
Please helping sir
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.
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.
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
I never seen that error. Watch my troubleshooting video.
Best tutorial
thanks for very good tutorial 👍🏻🌹
Hi bob will you consider to use some other brand touchscreen display?
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.
In arduino uno and nano there's only one serial port. Nothing to declare there
Instead of putting the code bauds=115200 in arduino code , can i have it set as a pre-initialization in nextion
Thanks Really Helped
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!
I am not sure what kind of display you bought but this tutorial is for the nextion display only.
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 :)
I feel that I already showed everything relevant to show about the nextion display.
Thank you very much.
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 ?
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.
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?
What is the tiny Arduino you use on the video, part number and where to buy.
Thank you
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
Thanks a bunch!
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
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.
Thank you!
some sources write the library like this #include "nextion.h" instead of
or
NexDSButton bt0 = NexDSButton(0, 2, "bt0"); what is DS?
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.
Yes Please i'll appreciate if you give me your Email address...
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. ..
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
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.
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.
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.
@@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.
Yeah, that's even better. Let arduino keep the state of the button and you just change the picture with arduino
thank you!
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?
I don't understand. Just make the OK button to send the text, like in my example
LIke Thomas said.. you were sent by coding heaven. I do have some problems though when I interface with STM32 nucleo. Working on it...:)
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
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.
Thank you
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?
I don't know, but I think it should work. Try it out and let me know
Can I use software serial 2,3 on the Nano with the nextion, instead of the hardware serial 0,1?
Works for sending data from arduino to the display, but doesn't work well when receiving data from the display
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.
I am glad I could help. If you have a video or pictures of your project, leave the links here.
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?
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
Start trying my examples and go from there.
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?
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.
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)
The link for the library I used is on the description
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.
I showed on this video how to do that
Thanks very much......
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.
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
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.
I don't know
Hi ,
in the code u had mentioned that u can change the baude rate to 115200 , ( bauds = 115200) , but with this change my nextion and nodemcu does not communicate ( led set at D5 ), when i change it back to 9600 it does communicate properly , does bauds code work with the regular 2.8 board.
It works with any display version. Did you change anything on my code? Did you cycle power OFF and ON both devices? The display has to receive the command to change the baud rate using the baud 9600. That's why I start the serial communication at 9600 and later give the instruction "bauds=115200" and after that end serial communication and start another serial in 115200. And power off the arduino so executes the setup.
HI
i did the following in the setup
void setup() { // Put your setup code here, to run once:
Serial.begin(9600); // Start serial comunication at baud=9600
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("bauds=115200"); // Set new baud rate of nextion to 115200, but it's temporal. Next time nextion is power on,
Serial.write(0xff);Serial.write(0xff);Serial.write(0xff);
Serial.end(); // End the serial comunication of baud=9600
Serial.begin(115200); // Start serial comunication at baud=115200
bt0.attachPop(bt0PopCallback); // Dual state button bt0 release
pinMode(D5,OUTPUT);
}
then i disconnect the nodemcu from the pc and connect it to a power bank and connected the tx and rx to nextion, then i click the dual mode , it does not work , then i comment the code for baude change and again reload the code and then it works.
By putting "bauds" instead of "baud" you are trying to change the default baud rate of the display, meaning it will have that by default. Try removing the "s" so you change the current baud rate instead of default to see if works.
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?
My only suggestion is to try my example and compare it with your code so you can see what you did differently
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?
I already show how to do what you asked in minute 8:50
@@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();
Oh. Good to know.
why can't I run the getText function?
even though other functions can be executed, do you have a solution?
will you consider to look at other brand touchscreen display?
Hello Thanks for you Tutorial
i have this error can you help Please:
exit status 1
'NexButton' does not name a type; did you mean 'Nextion'?
Thanks in advance
It means you have the wrong library
Is it possible to display the value of the pressed button in the text box placed on the second page by pressing the button (the value is 10) on the first page with only NEXTION TFT?
Yeah. Make a global variable and store the value there. You can access the data on any page
@@interlinkknight Thank you for the quick response. Do you know any instructive web page for Nextion TFT? I am very new to TFT and Arduino. I use Nextion Editor, but I do not know any commands, how to set up each compornents with the command. I just want to do press button, then the value is handled to the next page, then on the next page, the value stored to EEPROM by pressing the some button. I am sorry for my English, because English is my second language.
ITEAD have websites with all the commands. I show a lot of the basic stuff on my tutorials. Just watch all of my videos about the nextion display and try all my examples. I think everything you need is already there
@@interlinkknight Thank you for the advive.
I have an arduino genuino uno
This code works with?
Yes
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?
You tried my example, right? Are saying that my example works except the text?
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.
Is there a way to not to use buttons next/back but slide pages with a finger ??
I guess you could use a slider and write the code to change page with that, but honestly I prefer buttons for that since it uses resistive touch screen. There are models that are capacitive touch screen that might work better with that. Either way, it would not animate the pages like you think (side to side). It would load each page instantly without animation.
If a person wants to not use the RX, TX pins to input the values because the RX and TX are in use transmitting I/O then can we use another set of pins and create a serial alternate say on Pin 10 and 11? If so what is the proper syntax to set up the serial connections for these pins and translate the I/O from the Nextion Display to the RX. TX pins for wireless transport to a remote receiver interface?
In that case I would use an arduino mega that has 3 serial ports
@@interlinkknight I would but I'm in production design phase using the Arduino Nano or I can use the Arduino Micro. I used the Mega during my test phase and it works fine. But the touch screens have to be placed in an enclosure and I have to design the 3D CAD files for the Arduino board with 1 relay output and 1 limit switch. It uses RS485 transmitters to transmit data from the Arduino RS232 converter to a remote Master controller which is written in C# interface with a database. There are as many as 120 touch screens in the system acting as slaves but they all have to coordinate their actions through the master controller. For this reason I need to either create a dual Serial I/O or if it's possible just allow the Arduino to listen to both the RS485 I/o and RS232 from Nextion at the same time and just use DTR to control the data flow. I didn't want it to get this complicated...
Wow. Well, all I know is that you can send data to the nextion display with software serial, but receiving data doesn't work reliably.
@@interlinkknight Actually I learned you can simply connect TX of the screen to the RX of the Arduino and RX of the screen to the TX of the Arduino and connect the TX of the screen to the TX of the Transmitter and RX of the Screen to the RX of the transmitter and the transmitter will only listen to I/0 of the Arduino. So I CAD it in already and wrote the firmware using SMARTLINX. I hope I'm right. Just sent the Gerbers off to China for some protoboards.
HI,
I use arduino mega which have 3 tx/rx port - none of them load arduino sketch to the nextion....I replace to uno it load te sketch but only when yelow line
at nextion connect to pin 0 rx and the blue connect to pin 1 ???Do you know whay??
Why works on arduino uno and not on mega? Because the serial name on arduino mega has a number, and arduino uno/nano is just called "Serial". Replace everything that say "Serial" with "Serial1" and it should work. Obviously connect the display to the pins for serial1 (TX and RX)
Where to change?
At the softwarserial lib?
Software serial? No-one here is using/talking about software serial. You change it on the sketch.
does the programme work with Arduino UNO? or is it for Arduino Nano only?
Arduino nano = arduino uno. Same program, same pins, same everything.
Val numbers are sent easily although having some issues with send texts. Arduino Isn't letting me double quote to let me send txt over to the display? Any Advice?
Watch the troubleshooting video
@@interlinkknight Where can we find that?
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?
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