Data acquisition from USB temperature sensor in background function
5 次查看(过去 30 天)
显示 更早的评论
I have temeprature sensor which communicates with usb port. I have written function temp_init() in which connection is created and infinite while function where temperature value is saved to text file RS.txt.
s=serial('COM2','BaudRate',19200,'InputBufferSize',89,'Terminator',12);
fopen(s);
(...)
T=zeros(1);
temp=0;
while(temp<1000)
w=fscanf(s); %string with date, time, temperature etc
T=str2double(w(5:8)); %taking only temperature value
save('RS.txt', 'T', '-ascii');
end
fclose(s);
I want this function to run in background of my GUI program created with appdesigner.
Is it possible, and if so how?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!