Arduino mega and nextion basic 7"
One at a time buttons work. But not the whole thing?
I still have more to add also... but i need this going.
Also can i still add things to the loop? Or just nex listen?
nextion_thing.ino (15.2 KB)
Arduino mega and nextion basic 7"
One at a time buttons work. But not the whole thing?
I still have more to add also... but i need this going.
Also can i still add things to the loop? Or just nex listen?
nextion_thing.ino (15.2 KB)
(deleted)
So what my problem is exactly is.
When i upload a sketch with just the stuff for each relay one at a time it works exactly how it should. But when i upload it with all 8 relays and there variables and such nothing works.
I feel like im overloading or blocking serial communications some how...
Even if i just do a simple digital write for an led on or off for each of 8 buttons i can get it to work. But once everyytthing is added.. thats when serial doesent communicate
I did read about a "softserial" library. Its super basic but then im just trying to be able to change each relay to on/off/auto , change times (variables) with up/down buttons and get the temp and humidity displayed.
(deleted)
Hi
Saw your interchange on the Nextion Forum. Never seen such a bad forum and bad information for what is a good product. Did a write up in this forum on the simple way i use Nextion . Search Arduino to Nextion My way... Sorry I don't know how to post the reference
Similar idea to anwofos...
I don't use the itead library.. piece of crap that even Patrick will not own onto
Rod
Hello.
I know the Nextion and I know PICs, but not Aurdino (yet).
I've never tried any Nextion libraries, I write my own code to work the way I want it to. I can't imagine the host repeatedly querying the Nextion would work well at all, it would clog the serial port up with queries and be unresponsive for more than a few objects on the Nextion.
The way I do it is to put a series printh statements under the touch release event for every button on the Nextion. I send a series of bytes that identify the page and the button that has been pressed. I use interrupts on the PIC to detect receipt of the data from the Nextion and process it to do what I want.
I imagine the same is possible on an Aurdino without too much pain.
HTH
(deleted)
Yes, I agree I could have used the 'send component ID', that would work too. Probably just a matter of my own preferences that I chose not to. To expand a bit more on what I did, I send an ID for the button from 0x00 to 0xwhatever (however many buttons on the page) and similarly for the page, then use those 2 values in 2 switch statements to select which code runs in response to the button press.
I really don't like the idea of repeatedly querying the Nextion for status, takes up lots of time on the host and clogs the serial port. However, as with everything, if it works and you are happy with it, then that's good!
(deleted)