Skythrust
Member
- Jul 9, 2019
- 133
- 7
Hi there,
For a project I am creating a watcher which checks if a value is 0 or 1 every 5 seconds.
If the value changes from 0 to 1 it needs to execute an action, but when it has changed to 1
the action needs to be execute one time, if the value changes back to 0 and back to 1 another time.
Options;
But there should be another way to do this, it is important that it will work every time.
So when the value changes every time from 0 to 1 it needs to activate an action one time.
Any advise how I can make this?
For a project I am creating a watcher which checks if a value is 0 or 1 every 5 seconds.
If the value changes from 0 to 1 it needs to execute an action, but when it has changed to 1
the action needs to be execute one time, if the value changes back to 0 and back to 1 another time.
Options;
- I can stop the the timer
- I can set the timer in sleep for x minutes
But there should be another way to do this, it is important that it will work every time.
So when the value changes every time from 0 to 1 it needs to activate an action one time.
Any advise how I can make this?