I can't send button data to the nextion display arduino

Hello … Good night.
I’m using a Nextion display 2,8" and a Arduino mega 2560 to control the power of a heating system, which uses interrupts (attachInterrupt), basically the system detects the passage of the supply voltage sine wave by zero and “cuts” the output wave that feeds the resistance of heating according to the set temperature, using a PID. I have to use information in both directions (arduino mega 2560 <-> display Nextion), here is the problem, I can send information from Arduino to the display, but I cannot receive anything from the display buttons when I press them. I’ve already verified the following:

  1. There is sending information (temperature) from the arduino to the display (as I already mentioned);
  2. I am very suspicious that it is due to interruptions, but the strange thing is that I disabled the line that calls for interruption, but it remains the same.
  3. I’m using the own library of the display nextion and more updated, I commented some lines in the file Nexconfig.h, referring to Debug, but without success.

If you can give a light, thank you.

Hello Joao,


Before you posted your question you were directed to some instructions about getting the best from this forum, please go back and read them again and provide the information requested. No one can provide helpful answers with hardly any information.

I have a tutorial about Nextion displays at the top of the Displays section of the forum, I suggest you read it.

Phase control is not the usual method to control electric heating. Heating responds slowly to changes in input so instead of phase control you use burst control, which means having the power on for variable numbers of whole mains cycles. For example, if you turn on your triac for 5 cycles and off for 15 the heater will get one quarter power. If you use opto triac drivers with built in zero crossing you don't have to be concerned with zero crossing detection and all the problems that causes.

That said,if your code is well written I would not expect the interrupts to be a problem, but as you have not shown us your code no one can say.

Good luck.

Hi PerryBebbington.
Attached is my code for the Arduino and the Nextion display project, for evaluation. I apologize for not having sent it previously. Thanks in advance for the tips.

HMI File:


METH.ino (3.83 KB)

Hello Joao,


You have used the Nextion libraries, and, as I comment at the start of the Nextion tutorial, I don't use or know anything about the the Nextion libraries, so unfortunately I can't help, sorry.

Maybe someone else will help, but in my experience of being on this forum for a while there isn't anyone I can think of who frequently provides support for the Nextion libraries.

The introductory part of my tutorial tells you what your options are for help here. If you use my methods and get stuck then I'll try to help. If you use Sethian's library then he sometimes offers help for people who have problems with it.