MATLAB libraries of DHT11 sensor
조회 수: 10 (최근 30일)
이전 댓글 표시
If the DHT11 sensor is connected to my Arduino and I want to read the temperature and humidity data directly from that pin of Arduino to which it is attached without the help of any arduino code, is there any Matlab library available for that?
댓글 수: 1
MathWorks MATLAB Hardware Team
2021년 11월 22일
Hi Sadiq,
Kindly reach out to MathWorks Technical Support to get help in resolving your query
답변 (1개)
Walter Roberson
2021년 11월 20일
No, there is no MATLAB library for that.
However if you are using Simulink, see https://www.mathworks.com/matlabcentral/fileexchange/62878-arduino-additional-sensors-library-dht-lps331
Otherwise,
댓글 수: 4
Sébastien Josset
2022년 12월 7일
Hi! The answer would interest me as well :) When using Sadiq's modified code, I get:
Warning: Unsuccessful read: A timeout occurred before the Terminator was reached.
'serial' unable to read all requested data. For more information on possible reasons, see Serial Read Warnings.
out =
'nannannannannannannannan'
NaN
NaN
Some help would be great!
Sebi
Walter Roberson
2022년 12월 7일
If "out" is showing Temperature: 18.00 then the implication is that the data sent by the other side is not just numeric. If you know for sure that the "Temperature:" part is always going to be there then you can use fscanf() with a format of 'Temperature: %f' to read the numeric part directly, but if there might be a variety of text then you need to analyze the text to figure out which format to use.
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!