Start a new topic

Counter with - and + button


i want to increase and decrease a number(t0) by b1 and b3 .


(press event)

t0 = t0+1 for b1


t0 = t0-1  for b3

1 person likes this idea

Yes but the logic should be programmed in nextion,is it possible ? 


print t0 = t0 +10

Perhaps the press event can increment and decrement and the release event can transmit the result to your micro?


It is not possible as far I can see.

The t0 component has no field to store a numeric value.  It stores a string in t0.txt which can be added to or deleted from:

t0.txt=t0.txt+"1" // adds a "1" to the end of the t0.txt string.
t0.txt=t0.txt-1 // deletes the last character from the t0.txt string.

It would be a good feature, though.


thanks i think it would be a good feature too...


sounds like we need a new component that is numeric and not a string.  That would allow it to increment and decrement by using n0.val +1 for example.

And an smale skriping languagesn -> if else 

Hi,txt is not a value,but you can program "+"or"-" in your mcu.

here is the quick start tutorial:

I am now reviewing all of the Feature Requests, this will take some time, patience please.

Means for this have been implemented.  Number Component and cov function helps.

Option for implementation by MCU or entirely with Nextion