Page 767 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 767

//온도(data[2])가  조건에 만족하면 tips[n]에  있는 문자열을 왼쪽으로 쉬프트  시킨다.
                 if  (data[2]<=5) shift(tips[0]);
                 if  ((data[2]>=6)&&(data[2]<=9)) shift(tips[1]);
                 if  ((data[2]>=10)&&(data[2]<=11)) shift(tips[2]);
                 if  ((data[2]>=12)&&(data[2]<=16)) shift(tips[3]);
                 if  ((data[2]>=17)&&(data[2]<=19)) shift(tips[4]);
                 if  ((data[2]>=20)&&(data[2]<=22)) shift(tips[5]);
                 if  ((data[2]>=23)&&(data[2]<=26)) shift(tips[6]);
                 if  (data[2]>=27) shift(tips[7]);
            }


            void  board2()    //불쾌지수에  따른 문자열을 shift함수에  넘겨준다
            {
                 //불쾌지수 계산 공식에 대입하여 불쾌지수를 계산한다 (온도:data[2],습도:data[0])
                 float  bol = (9*data[2]/5)-0.55*(1-data[0]/100)*(9*data[2]/5-26)+3

                 //불쾌지수 값이 조건에 맞으면  tips2[n]을 왼쪽으로 쉬프트  시킨다
                 if  (bol>=80) shift(tips2[0]);
                 if  ((bol<80)&&(bol>=75))  shift(tips2[1]);
                 if  ((bol<75)&&(bol)>=68)  shift(tips2[2]);
                 if  (bol<68) shift(tips2[3]);
            }


            void  board3()    //습도에 따른 문자열을 shift함수에 넘겨준다
            {
                 //습도(data[0])가  조건에 맞으면 tips3[n]을 왼쪽으로 쉬프트 시킨다
                 if  (data[0]<30)  shift(tips3[0]);
                 if  (data[0]>70)  shift(tips3[1]);
                 else  shift(tips3[2]);
            }


            char DHT11(void)      //온도,습도를 받아오는 함수
            {
                 //데이터시트 참고


                 unsigned  char  n,k,idx;


                 data[0]=data[1]=data[2]=data[3]=data[4]=0;  //자료 초기화

                 DHT_OUT=0;  //PORTA의 0에 0을 입력한다




                                                         -  760  -
   762   763   764   765   766   767   768   769   770   771   772