Checking the timer Running property

24 ビュー (過去 30 日間)
Sallie
Sallie 2018 年 11 月 8 日
回答済み: Paul Kloker 2019 年 7 月 2 日
Hi all,
I want to check the running status of a timer in my program. The timer is used to turn a digital pin on an arduino pin to turn On and Off at a specific time and then turn it off. I want to perform other task if the timer is running. I used the following code to check the running property of the timer but it reads always ON.
R = get(ledtimer,'Running');
if (R =='on')
fprintf('Timer is running');
end

回答 (1 件)

Paul Kloker
Paul Kloker 2019 年 7 月 2 日
Hey Sallie,
just got the same problem. Here is my solution:
R = get(ledtimer, 'Running');
if isequal(R ,'on')
fprintf('Timer is running');
end

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by