Page 181 - 2
P. 181

PORTB.1 = 1;
                        delay_us(1500);
                        PORTB.1 = 0;
                        delay_ms(20);
                    }
                }
                else if(doornum%2==0){
                    for(i = 0;i<50;i++){
                        PORTB.1 = 1;
                        delay_us(3000);
                        PORTB.1 = 0;
                        delay_ms(20);
                    }
                } rx=100;
            }


            void cooler(){
                coolernum++;
                if(coolernum%2==1){
                    PORTA.7 = 1;
                    delay_ms(1000);
                    if(windownum%2==1){
                        window();
                    }
                }
                else if(coolernum%2==0){
                    PORTA.7 = 0;
                } rx=100;
            }


            void night(){
                nightnum++;
                if(nightnum%2==1){
                    if (coolernum%2==1){cooler();}
                    if (rightnum%2==1){right();}
                    if(windownum%2==1){window();}
                    if (fannum%2==1){fan();}
                    if (doornum%2==1){door();}
                    EIMSK = 0b00010000;
                    EICRB = 0b00000010;
                }
                else if(nightnum%2==0){
                    EIMSK = 0b00000000;
                    EICRB = 0b00000000;
                }


                                                         - 181 -
   176   177   178   179   180   181   182   183   184   185   186