Start a new topic

Nextion Touch Screen "Start" button to start arduino loop

 How can I trigger the programmed loop in Arduino to start with a press of a button from Nextion.

I built the .UNO and HMI.


It is for a project I'm building Please Help!

ino
HMI
(71 KB)

You can not in this manner.


Aurduino runs setup(), and immediately loop()

For this there is no intervention.



Thank You for quick reply!

What can I do to trigger this function ( my options?)

I was thinking, have Arduino to listen on one of its analog pins and then start void loop ( since Arduino runs only one line at a time.

 

Please look at the Iteadlib Arduino Nextion Library

You will want to download and install.

https://github.com/itead/ITEADLIB_Arduino_Nextion

Please configure NexConfig.h for the UNO as directed in readme.md


Then take a look through the library examples

http://support.iteadstudio.com/support/discussions/topics/11000009208


The way this works is the Nextion is initialized in the setup() with nexInit()


Arduino loop() runs immediately after setup

in each iteration of the loop

    - nexListen looks for your Nextion Touch Events

       - if one is found and you have set it up,

          then nexListen will call your procedure.

    - all other things you define in your loop() will be run

At the end of loop, loop() starts all over again.

 

CompButton example will show you how to trigger code from a button

Study the library code, study the examples.

Thank You Sir, I have some HomeWork to do
Ez
Thank You!

 

Login or Signup to post a comment