Hi,
I am using matlab with arduino so the senerio is I have two buttons connected with arduino so when ever I press button 1. I want to store time in a csv file. but when ever I press button two other csv file is generated again continously storing button 1 time stamps. can any body help me?
Regards,
Haziq

댓글 수: 6

Walter Roberson
Walter Roberson 2019년 3월 1일
what format do you want to store the times in? Posix time?
Muhammad Haziq
Muhammad Haziq 2019년 3월 1일
I need in this format ('HH:MM:SS;FFF').
Walter Roberson
Walter Roberson 2019년 3월 1일
Okay, and are you being sent the time data, or are you extracting it from the host MATLAB session? What format is the time data in?
I am not clear on the two buttons. It sounds as if when button 1 is pressed, the timestamp is to be written to one particular csv file, and that when button 2 is pressed, a copy of the first file is to be taken??
Muhammad Haziq
Muhammad Haziq 2019년 3월 1일
The time is the PC current time which I can take from this command (datevec(now)).
for second question actually I have a recording time period of 5 minutes let say this is my trial duration. now when ever I pressed button 2 a new csv file is open (let assume name of file is rec_0) and in that file I will write down time stamps which I have take from button 1 after recording time (5 minutes) finished I will generate a low signal from button 2 this will close the file(rec_0) now the program is continously reading input from button 2 whenever button 2 becomes high it will generate a new file named (rec_1) and it will record time stamps from button 1. This will go on continously in a while loop.
Walter Roberson
Walter Roberson 2019년 3월 1일
편집: Walter Roberson 2019년 3월 1일
Is it important that the timestamps be written to the file as soon as button 1 is pushed, or could they be accumulated in memory and not written until button 2 is pushed?
Does anything else need to get written into the file?
Muhammad Haziq
Muhammad Haziq 2019년 3월 1일
Yes as soon button 1 is pressed time stamps will be written in file no other thing is written.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

제품

릴리스

R2018a

태그

질문:

2019년 3월 1일

댓글:

2019년 3월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by