Thanks for the quick response and the guidance on the forum. Unfortunately when I try to modify the post, the toolbar mentioned in the guide doesn’t come up.
Beneath your post (only your post, not mine or anyone else’s) at the bottom right you should have ‘quick edit’ and ‘More’. More has a drop down list which has ‘Modify’. Select ‘Modify’. You should have your post in an edit window with a tool bar across the top. The left hand icon on the tool bar should be </>, that’s the one for code tags. Select your code, click that icon. Click save.
If you really don’t have a tool bar then I have no idea, sorry.
However, in doing it the way you describe, I end up with about 50+ buttons communicating with the Arduino Uno and some complex math to ensure that the various commands for each blind dont interfer with each other. This is already giving me warnings of low memory available.
This is where it gets difficult to comment without seeing your code, and even if I see it I confess to not being very good at reading other people’s code. Usually on here I leave sorting out code problems to other people unless it’s fairly simple or the problem is obvious. My feeling is that 50 variables should not be a problem for even the smallest Arduino. Have you written functions to do the maths, so you call one function to do a particular thing, rather than repeating the same code multiple times?
If you really want your Arduino to ask the Nextion to return the value of a variable or number try using ‘get’. I’ve not tried it myself. However, the problem with using ‘get’ is that it won’t send the value in way my code was designed to handle, so you are on your own there. The other problem with doing it this way, and one big reason I would not even attempt to do it, is that if the Arduino has to ask the Nextion for a value, then to keep the whole thing responsive to user actions the Arduino has to keep asking, probably at least 20 times per second, every second, all day long. That puts a big demand on the Arduino and the serial port. If you don’t have the Arduino doing this then when a user presses a button (or whatever) nothing will happen until the Arduino asks for the data.
A suggestion might be that after you perform maths on the Nextion the next thing is does is to send the result, would that work for you?
I think you have the following choices:
Use my methods with all the maths on the Arduino, if the Arduino you have isn’t powerful enough buy a more powerful one, but before you do that optimise your code. I would think ALL code can be optimised, especially if you are new to this. If you use my methods I can continue to offer help.
Use the Nextion libraries, my methods are not designed to work with the libraries, maybe you or someone can combine them to work together but I certainly would not attempt this. I can’t help with Nextion libraries but if you do use them then see Ray Livingston’s version of them, he has fixed a load of bugs. There is a link from my tutorial.
Design your own method of communicating with the Nextion, that’s what I did! If you design your own method you can fix whatever short committing you see in my methods or the libraries.