Start a new topic

Timer with Nextion HMI Enhanced Model only

Hey guys.

 

I want to ask you if it is possible to create a "Timer" by using a Nextion HMI (Enhanced Model) only without another MPU.

 

For now, I tried to put my ideas into a the Nextion Editor and create something like a program. I used the "Timer" from the toolbox. But I am not very satisfied with the result. There is a delay or the timer is too fast.

 

Years ago, I wrote some small C-programs with functions, libraries or interrupts.

Are there such possibilities by using the Nextion Editor and an Nextion HMI or not really?

 

with best regards 



HMI
(373 KB)

@Juan


A timer can only run while it is enabled.

- a timer is enabled by tm0.en=1

- therefore a timer is disabled by tm0.en=0


If a timer is disabled, how can it continue to decrease?

  therefore focus coding for your timer to stop at proper moment

Sorry, Coercion of code not tolerated, Plenty of HMI code already posted.

Learning comes by reading and practice in Editor


Start with Basics

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


can u upload the code and HMI pls. 

im learning and havent so much idea :(

i need a countdown timer, but doesnt stop at 0.0 

Perhaps post it as a Challenge in Stump the Chump

  only a few days left before that closes

- be specific in the challenge as to what little thing is to be done.

  when we accomplish, we send you the HMI on how to do.

I try it Martin but I can not make it work... :(

when you change page, your other page is unloaded

You must program with this in mind


You must review the code

It is not enough to just copy


in a second timer you can not use the same code.

- it will trigger the same MCU function as first timer


one more problem is when i change page with a button time return to first value if i return to timer page... :(

 

thank you martin, this worked!!! :) i take back this :

image


if i want to add a second timer  tm1 end, i add the same? printh 65 01 01 00 FF FF FF
or change id number?

 

You must start to learn how to give commands rather than cut copy paste and hope it does as you wish.


To have your timer stop at 0:0:0 then

  - you must issue a stop to the processes that is decrementing

  - since a timer is the process that is decrementing

    issuing a command as tm0.en=0 disables timer named tm0

In the same block of code between braces { } add your component

  - printh 65 01 01 00 FF FF FF

  - this print command simulates touch release of page1 component with id 1

i can´t help for the arduino problem. It didn´t work properly for my project. I wantet to send the ID component to arduino to make an alarm sound with an piezo speaker. But somehow i couldn´t create a conectuin between arduino and nextion. My solution for this Problem was to buy an "Expansion Board For Nextion Enhanced Display I/O Extended". But there was no time to test this solution. I think it is easier wiht this, but i don´t know what your project is and if it works.


I attach my program. It is not perfect and i guess there are better solutions for some functions in there. But this was the best i could do. If there are any question i try to answer them


HMI
(1.93 MB)
If countdown completes values stay in 0:0:0.. Yes I have 4.3" enhanced model.

it IS possible.

how much time is being counted downward?

after countdown completes, is the timer reset to specific value again?

And confirm this is for an enhanced model?


and one more help... when timer ends 0:0:0 i want to send me a component ID in simulator return data for arduino move... it is possible??

 

hi @HRdt and thank you. upload it if this help me :)

 

Login or Signup to post a comment