How can you create alert when making a digital temperature using arduino on GUI
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to create a digital thermometer using Arduino. I also want to make sure there is an alert on high or low-temperature changes. Not sure how to create the alert.
2 件のコメント
Achyutha Hosahalli
2017 年 10 月 16 日
Hi Refat !
You can follow this video to create digital thermometer using arduino on GUI. To create an alert,once you read the temperature, you can have a conditional statement (if/else) to check the threshold values for high/low temperatures and use an edit box to display the alert by setting it with alert text. For example, when a push button is pressed, the below code snippet can be executed
x = 0;
global a;
v = readVoltage(a,'A0');
analog = (v/0.00488745);
temp = analog*0.48828125;
set(handles.edit1,'String',num2str(temp)); % edit1 is the tag of edit box used to display the temperature
if temp > 40
set(handles.edit2,'String','HIGH'); % edit2 is the tag of edit box used to display the alert
elseif temp < 5
set(handles.edit2,'String','LOW');
else
set(handles.edit2,'String','');
end
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Arduino Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!