Nextion 3.5 enhanced HMI as GUI for ESP32 LyraT using Arduino

Hello Guys,
I created a graphical user interface for the Nextion enhanced HMI. My goal is to send Nextion functions (Play, Pause, Volume- and Volume+) from the Nextion GUI to the ESP32 using an Arduino Sketch. For this instance, I will focus on the Play Button. When the Play Button is pressed on the Gui to send the command to the ESP32 TouchPad GPIO33 which is the TP pin to execute the"PLAY" command on the ESP32. In the rough draft of my sketch, I am unsure of how to write the code to the Play component pop callback function of the Nextion "Play button" to the ESP32 GPIO 33 which is where the play pin is located. I believe that Pin 33 on the ESP32 should be an INPUT pin that will be controlled by writing the PIN high or low. This is my first go I know it needs a lot of work constructive advice greatly appreciated I am lost,,,

The component will Play when Play Button on the Nextion GUI is pressed.

The attributes for the Nextion are

:Declare a button object [page id:0,component id:3, component name: "Play"
NexButton NexButton(0, 2, "Play")

//Reads a digital input on pin 33 of the ESP32, prints the result to the Serial Monitor

// digital pin 33 has a pushbutton attached to it.”PLAY”:
int pushButton = 33;

// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
// make the pushbutton's GPIO pin 33 an input:
pinMode(pushButton, INPUT);

// the loop routine runs over and over again forever:
void loop() {
// read the input pin:GPIO 33
int buttonState = digitalRead(pushButton”Play(HIGH?”);
// print out the state of the button:
delay(1); // delay in between reads for stability



Please read THIS POST for future reference.


As you seem unable to comply with simple requests you now have 7 days forum holiday to read the link I gave you.