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!