DHT20 Temperature and Humidity

버전 0.7.1 (6.48 KB) 작성자: Eric Prandovsky
MATLAB + Arduino I2C DHT20 Temperature and Humidity sensor support
다운로드 수: 143
업데이트 2024/11/5

라이선스 보기

Support for the latest DHT sensor: the DHT20
The DHT20 sensor is an I2C sensor and must be connected to the I2C port of the Arduino
1. First, define your Arduino in your workspace:
a = arduino('<your COM Port>','Nano3','Libraries',{'I2C'});
2. Then, tell MATLAB that there is a DHT20 sensor attached to it.
dht20obj = dht20(a);
3. Once you've created your sensor object, you can ask it to take temperature and humidity readings, or both:
myTemperature = readTemperature(dht20obj);
myHumidity = readHumidity(dht20obj);
myDHTSensorData = readRawSensorData(dht20obj);
% can also call it using . annotation:
dht20obj.readHumidity;
dht20obj.readTemperature;
dht20obj.readSensorData;

인용 양식

Eric Prandovsky (2026). DHT20 Temperature and Humidity (https://kr.mathworks.com/matlabcentral/fileexchange/121792-dht20-temperature-and-humidity), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2022b
R2021a 이상 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
도움

도움 받은 파일: MATLAB Support Package for Arduino Hardware

버전 게시됨 릴리스 정보
0.7.1


Updated to work with r2024+ where device.read() is no longer visible to the sensor class and the SupportedInterfaces property has been added.

0.7