Listening to mulltiple serial ports

Is there any way of changing the stock Nextion library to allow it to listen to multiple serial ports on an arduino mega (I. E. two nextions at once) ? I know I can abandon the library but with the amount of code I’ve already written around the stock library, I don’t really want to have to rewrite a lot of it.

Thanks for the help.

The short answer is yes. You’ll need to instantiate two Nextion objects on distinct UARTs and following that, two listener object lists which will allow you to put two distinct nexloops as event dispatchers in the main loop. The rest is trivial.

Hi,
I have updated Enhanced-Nextion-Library with multiple display support, if still interested/needed.