count up a variable
Posted: 19 Oct 2019, 21:15
hi i'm trying to count up /down a value that i initialized at boot, with two buttons.
i wanted this value to be set at boot or later with a http send via an app,
and increase/decrease it locally via Buttons.
it gets set at boot to 40 like i want but unfortunately,
when i press a button its set to 1 or -1 not to 41,42,43 and so on.
Code: Select all
On System#Boot do //When the ESP boots, do
//[DummyVar#TempSetpoint]=40
TaskValueSet 3,1,40
endon
on ButtonLeft#state=0 do
//[DummyVar#TempSetpoint]-
TaskValueSet 3,1,-1
endon
on ButtonRight#state=0 do
//[DummyVar#TempSetpoint]+
TaskValueSet 3,1,+1
endon
and increase/decrease it locally via Buttons.
it gets set at boot to 40 like i want but unfortunately,
when i press a button its set to 1 or -1 not to 41,42,43 and so on.