Hello, I have a problem by changing pages. I have one button and two pages(page1 and page2) First the screen stays on page1. When button is pressed, it will switch to the page2. button not pressed. the page2 can't back page1. I tried a lot of time and couldn't do it. like this↓ val = digitalRead(BUTTON_PIN); if(val == LOW){ Serial.print("page 1"); } else if(val == HIGH){ Serial.print("page 2");
There are a few ways to do this. One way, the Arduino could request the current page on a timed interval, then alter text if page has changed. A second way would have the Nextion send a command to the Arduino when the page changes and the Arduino could respond with a command to change text.
That is the way I would recommend. This video should help you with this. It has been awhile since I have reviewed this video but based on feedback you can alter text. If you want me to review any code you can ask for assistance on the Cheap Controls website.
Is it possible to get simple page number under Arduino without Nextion library? In addition, I used to use an event under arduino for not Nextion lcd screens. Such as for example to check if the screen is simple touched. Is it possible something like that? Thanks.
You can use the sendme command to get the current page number. th-cam.com/video/ySjoYyXbJUM/w-d-xo.html It is also possible to detect a screen touch. I am not sure how to describe that. I am working on videos for all aspects but I don't think I have one for that yet. You can search through all my videos at www.cheapcontrols.com. I am trying to get the code for each video downloadable.
@@CheapControls Thank you for your replay. I think finally I did it. What I wanted to do is to change amplitude and frequency of a sinus wave and send it to the dac. I wanted to get values from the number box in the Nextion and send it to the Arduino and use later in the calculation. I know now how to get the value but using numerical keyboard under Nextion messing up with touch press/release event. Pressing and release shows the keyboard only I would like to get the value after typed the value. I solved it by adding to the keyboard's "OK" button this line at the end: prints p[loadpageid.val].b[loadcmpid.val].val,0. I can get values after pressing OK button. Maybe not the best way but at least it works
I want to make sure I understand. Do you want a single push button momentary switch to make the Nextion change from page 1 to page 2 to page 3 to page 4 to page 5 and so on for as many pages as you have and in order or do you want something else?
Hello, I have a problem by changing pages. I have two pages with "Pictures". I use these as buttons. So I change the picture with the arduino to a pressed button when the picture is pressed. But if I change the page and go back to page one for example, the pictures goes back to the default picture. The pictures/buttons control the digital outputs of the arduino. So I need the right picture to show the status of the output. I could check every output when I change the page and Update the pictures. But I thought maybe there is a easier solution?
Hi i am working on a project for a touch screen controlled receiver which i am using the 2.8" Nextion display i have the enhanced version. i have it mostly done but i am asking is there anyway of getting the Nextion display to remember a page id then allowing you to return to that page. For example if the receiver is in the tuner mode the page has a button to navigate to a audio settings page where you can adjust the sound settings on that page i have added a 'back' button in order to return to the previous mode (page). I currently get the arduino to remember the page id of say the tuner page and if i navigate to the sound settings page and do the adjustment then i touch the 'back' button the arduino then changes the page back to the previous page (tuner) is there a way to do this in the Nextion display. So basically returning to a previous page from the current one using a button? If anyone has the answer please comment with details of a tutorial for it.
You can store it as a system variable or write to the eeprom. I am not 100% sure but I think it would work. I will try to remember to look into this and post another comment. If you don't see a second response in a couple days make a comment at www.cheapcontrols.com and I will reply to your comment with an Email
Hello, i try to retrieve data from nextion i have try your example, but in terminal i have always nul nul nul when i touch screen, have you an idea of this ? Thank
@@SpinaRCSpeed You can download the examples from cheapcontrols.com and compare or you can ask to join the cheapcontrols private Facebook group where you can post your files and we can help troubleshoot. Both are free and available.
Hello, thank you for this nice video. Your shown method will work with 2 pages, but what i do when i have more pages such like three or four pages? Is then a pure software solution then not be better than as a hybrid solution? A video about a pure software solution would be very nice, if one exists, where can eeryone find this (link)?
I am not sure what you are asking. this example has a physical switch that has two positions. Do you want a physical switch with two positions that control more than two pages? Or do you have a different example that you are addressing? Please elaborate a little bit more on your question. Thank you for watching
"Dont fall asleep" that was funny.
Once again clean and concise. Thanks
Glad you enjoyed
best explanations on nextion, subscribed :)
Awesome, thank you!
Hello, I have a problem by changing pages. I have one button and two pages(page1 and page2)
First the screen stays on page1. When button is pressed, it will switch to the page2.
button not pressed. the page2 can't back page1. I tried a lot of time and couldn't do it.
like this↓
val = digitalRead(BUTTON_PIN);
if(val == LOW){
Serial.print("page 1");
}
else if(val == HIGH){
Serial.print("page 2");
I am not sure. You can request help at www.cheapcontrols.com. We will reply and then you can submit your code for evaluation.
hi great video, is there anyway to update text from arduino when the page changed?
There are a few ways to do this. One way, the Arduino could request the current page on a timed interval, then alter text if page has changed. A second way would have the Nextion send a command to the Arduino when the page changes and the Arduino could respond with a command to change text.
@@CheapControls thanks, i prefer the second way
That is the way I would recommend. This video should help you with this. It has been awhile since I have reviewed this video but based on feedback you can alter text. If you want me to review any code you can ask for assistance on the Cheap Controls website.
Is it possible to get simple page number under Arduino without Nextion library? In addition, I used to use an event under arduino for not Nextion lcd screens. Such as for example to check if the screen is simple touched. Is it possible something like that? Thanks.
You can use the sendme command to get the current page number. th-cam.com/video/ySjoYyXbJUM/w-d-xo.html It is also possible to detect a screen touch. I am not sure how to describe that. I am working on videos for all aspects but I don't think I have one for that yet. You can search through all my videos at www.cheapcontrols.com. I am trying to get the code for each video downloadable.
@@CheapControls Thank you for your replay. I think finally I did it. What I wanted to do is to change amplitude and frequency of a sinus wave and send it to the dac. I wanted to get values from the number box in the Nextion and send it to the Arduino and use later in the calculation. I know now how to get the value but using numerical keyboard under Nextion messing up with touch press/release event. Pressing and release shows the keyboard only I would like to get the value after typed the value. I solved it by adding to the keyboard's "OK" button this line at the end: prints p[loadpageid.val].b[loadcmpid.val].val,0. I can get values after pressing OK button. Maybe not the best way but at least it works
Very unique solution. Good for you.
how if using momentary switch button not self locking button to control more than 2 pages?
I want to make sure I understand. Do you want a single push button momentary switch to make the Nextion change from page 1 to page 2 to page 3 to page 4 to page 5 and so on for as many pages as you have and in order or do you want something else?
Hello, I have a problem by changing pages. I have two pages with "Pictures". I use these as buttons. So I change the picture with the arduino to a pressed button when the picture is pressed.
But if I change the page and go back to page one for example, the pictures goes back to the default picture. The pictures/buttons control the digital outputs of the arduino. So I need the right picture to show the status of the output. I could check every output when I change the page and Update the pictures. But I thought maybe there is a easier solution?
I am not sure but a quick fix might be to set the button as global. Let me know if you have already tried that. Good luck and thanks for watching
@@CheapControls Wow. That works! Thank you for the good idea!
Hi i am working on a project for a touch screen controlled receiver which i am using the 2.8" Nextion display i have the enhanced version. i have it mostly done but i am asking is there anyway of getting the Nextion display to remember a page id then allowing you to return to that page. For example if the receiver is in the tuner mode the page has a button to navigate to a audio settings page where you can adjust the sound settings on that page i have added a 'back' button in order to return to the previous mode (page). I currently get the arduino to remember the page id of say the tuner page and if i navigate to the sound settings page and do the adjustment then i touch the 'back' button the arduino then changes the page back to the previous page (tuner) is there a way to do this in the Nextion display. So basically returning to a previous page from the current one using a button?
If anyone has the answer please comment with details of a tutorial for it.
You can store it as a system variable or write to the eeprom. I am not 100% sure but I think it would work. I will try to remember to look into this and post another comment. If you don't see a second response in a couple days make a comment at www.cheapcontrols.com and I will reply to your comment with an Email
Hello, i try to retrieve data from nextion i have try your example, but in terminal i have always nul nul nul when i touch screen, have you an idea of this ? Thank
In the Nextion Editor click on the button that is giving you the nul nul nul and make sure that "Send Component ID" is NOT checked.
@@CheapControls i have try all with and whitout and its same ... When i debug, the data is in simulator return so i dont know
@@SpinaRCSpeed You can download the examples from cheapcontrols.com and compare or you can ask to join the cheapcontrols private Facebook group where you can post your files and we can help troubleshoot. Both are free and available.
@@CheapControls thanks i will try tonight and contact you
Hello, thank you for this nice video. Your shown method will work with 2 pages, but what i do when i have more pages such like three or four pages? Is then a pure software solution then not be better than as a hybrid solution? A video about a pure software solution would be very nice, if one exists, where can eeryone find this (link)?
I am not sure what you are asking. this example has a physical switch that has two positions. Do you want a physical switch with two positions that control more than two pages? Or do you have a different example that you are addressing? Please elaborate a little bit more on your question. Thank you for watching
I actually have 12 pages with about 1MB already.