Start a new topic

Serial Help needed

I don't fully understand how to send data over serial from my Nextion display to a Photon using the Nextion editor. I want to push a button and then read in that the button was pushed on my Photon to then perform some kind of event (starting with a simple turning on an LED to make sure it works).

Does anyone have experience using the Nextion display with a Photon and know how to send data from the Nextion to the Photon and read it properly?  It seems like the Nextion will send multiple bytes each transmission.

Sorry I'm a newbie with the Nextion and Photon. ANy help will be appreciated.

I have ported the Nextion Arduino library and it can be found in Particle Build as `ITEADLIB_Nextion` - have a look at the examples and ping me @ScruffR in the forum, if you need more help.

@ScruffR The ported library looks great and has helped a lot for the most part. I am still having some issues trying to figure out how to type the user coded in the Nextion Editor so when (let's say I push a button) it will send the button id to the Photon.

Do you have any examples of how to get this to work?

Thanks again for all the help.

I have the Nextion command list page and tried to get it to send what I want multiple times. I feel like I am just typing something wrong or trying to recieve it in the wrong way

If you want give me your Particle @ here so we can chat there (I'm online there most the time ;-) )

But you don't need to code anything, just tick the checkbox "Send Component ID" on the "Touch Press Event" and/or "Touch Release Event" tab(s).

I'm not sure what my particle @ is and to even find out what it is. I'm completely new working with the Photon and its website. You have helped a ton so far and I greatly appreciate it. I got my display to communicate with my Photon. I was wondering if you could help clear up something for me.

In regards to the library (which is awesome). I added it to my app in particle build but I am not quite sure how to work it. I know that sounds weird so I will try and be a little more specific. When I have a button touch event I turn on an LED for a specified period of time. I have it so the screen will change while I'm pressing the button but once I release it changes back to the original.

Using the library can you guide me in making it so that image will stay changed for the duration the LED is on?

I hope this makes sense to you. And hopefully I can figure out my particle @ and how to chat with you there.

Thanks again for all your help!  :)

Patrick, have you ever posted anything on or at least logged in there?

If not, you should give it a try and sign up.

Your user name there can be used in a post like @ScruffR (which is mine) to ping another user on the board or send a private message.

About the button question:

In a case like you describe, it might be the easiest to use a DualStateButton instead of a mere Button.

This button acts like a toggle button which stays in one position till it is touched again (or its state changed via code).

So you should first try out this component and for the next step - how to control the state by code - you can ping me on

Login or Signup to post a comment