Timer callback with alternating paths based upon which path was triggered before
1 回表示 (過去 30 日間)
古いコメントを表示
Claudius Simon Appel
2020 年 12 月 23 日
回答済み: Sean de Wolski
2020 年 12 月 23 日
Hello,
I am trying to built a timer function/ object that reminds me to stop sitting for hours on end, because I am sadly one of those people who sit way too much.
I know how to get a simple timer started up, and have more or less everything I need except for being able to switch between two paths inside the callback function, based upon what was executed before. So if at T0 Path A is triggered within the timer , at T1 we should go to Path B, then at T2 back to A and so on.
For that part though, I have no clue how I would even achieve it.
Thank you and stay healthy.
Sincerely,
C.A.
0 件のコメント
採用された回答
Sean de Wolski
2020 年 12 月 23 日
You could use a simple persistent variable in your callback function to maintain state.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Manage Products についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!