Closed yangjianlin-c closed 3 years ago
Use OneButton library to query the button.
https://www.arduino.cc/reference/en/libraries/onebutton/
You can use a Task to "tick" buttons periodically, and put activation in the callback for a click or DoubleClick event.
OK. thanks for your suggestion. Then how to stop running task? with disableAll() or something else? Seems I can't stop the running task from another task with disableAll function.
Seems I find the reason. I first abort() the running task and then disableAll(). As in the workEnd() and restEnd() I request it start a new task. So not able stop the loop, right?
You disable a running task by calling Task.disable(). Abort() is a special case and should be only used as such. You can also just let the task run it's course and stop by itself
Please refer to TaskScheduler wiki and examples for help. Unfortunately I cannot provide educational support. Only issue resolution.
Hi Sir, I'd like to design a pomodoro clock with this library. The main function is as below:
I have build a very simple code to run the clock. But I'm not sure how to response or monitor the button status to control the schedule. Could you provide any suggestion please? Thanks.
And the online link of this code: https://wokwi.com/arduino/projects/307877482987520578