フィルターのクリア

MATLAB libraries of DHT11 sensor

29 ビュー (過去 30 日間)
Sadiq Akbar
Sadiq Akbar 2021 年 11 月 20 日
コメント済み: Walter Roberson 2022 年 12 月 7 日
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
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
Walter Roberson 2021 年 11 月 20 日
  4 件のコメント
Sébastien Josset
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
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 ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by