01-07 02:28
Recent Posts
Recent Comments
Tags
- ํ์ด์๊ณต๋ชจ์
- ICT
- Java
- JOBํ๊ณ
- TSQL
- ์ด๋ธ์
- python
- ํ์ด์
- ICT๋ฉํ ๋ง
- DATABASE
- mysql
- ์คํฝ์ค๋น
- appetizer
- ์๋์ด๋ ธ
- ์คํฝ๋ ํ
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
- ์จ์ผ๋ํ
- RaspberryPi
- ์กํ๊ณ
- ํ์ด์ฌ
- API๋ง์ผํ๋ ์ด์ค
- Spring
- Naver Cloud
- linux
- ict๊ณต๋ชจ์
- SQL
- ์๋ฐ
- DB
- ํ๋ก๋ณด๋ ธ
- API MarketPlace ๊ธ๋ก๋ฒ ์ํฌํฐ์ฆ
- Today
- Total
miinsun
[์๋์ด๋ ธ] ์จ์ต๋ ์ผ์ ์ ์ด ๋ณธ๋ฌธ
๐ป ์ค์ต ํ๊ฒฝ
Board : Arduino UNO
Language : C
๐ฌ ์๊ตฌ ์ฌํญ
DHT11 ์จ์ต๋ ์ผ์๋ฅผ ์ฐ๊ฒฐํด ์ผ์์์์ ๋์งํธ ์ ํธ๋ฅผ ๋ฐ์์ ์ถ๋ ฅ
-> DHT11 Library ํ์ฉ
๐ Code
#include <dht.h>
dht DHT;
#define DHT11_PIN 2 //์ฐ๊ฒฐ๋ ํฌํธ ์ง์
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println(DHT_LIB_VERSION);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print("DHT11, \t");
int chk = DHT.read11(DHT11_PIN);
switch(chk)
{
case DHTLIB_OK:
Serial.print("OK,\t");
break;
default:
Serial.print("ERROR, \t");
}
Serial.print( DHT.humidity, 1);
Serial.print(", \t");
Serial.println(DHT.temperature, 1);
delay(2000);
}
'IoT > Arduino' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์๋์ด๋ ธ] ๋ธ๋ฃจํฌ์ค ํต์ (0) | 2021.12.03 |
---|---|
[์๋์ด๋ ธ] ์๋ณด ๋ชจํฐ ์ ์ด (0) | 2021.12.03 |
[Arduino] LCD ๋์คํ๋ ์ด ์ถ๋ ฅ (0) | 2021.12.03 |
[Arduino] LED ๋ฐ๊ธฐ ์กฐ์ (0) | 2021.12.03 |
Comments