Skip to content
Snippets Groups Projects
Commit 2fc1fd3d authored by Eunchae Lee's avatar Eunchae Lee
Browse files

Update DHT11.c

parent 15b194f3
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,7 @@ void *server_thread(void *arg)
// 성공 시 연결 성공 메세지 출력
printf("Connected to server\n");
// 서버로부터 20초 간격으로 send
// 서버로 20초 간격으로 측정 데이터 평균 send
while (1)
{
send_average(sock);
......@@ -121,22 +121,22 @@ void read_data()
for (int i = 0; i < MAX_TIME; i++)
{
count = 0;
// count the duration of each state
// 각 상태에 대한 count 세기
while (digitalRead(PIN) == state)
{
count++;
delayMicroseconds(1);
// to avoid infinite loop
// 무한루프 탈출
if (count == 255)
{
break;
}
}
// store the current state
// pin의 현재 상태 저장
state = digitalRead(PIN);
// to avoid infinite loop
// 무한루프 탈출
if (count == 255)
{
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment