Page 244 - MDP2022-3
P. 244

UCSR1A  =  0x00;
                    UCSR1B  =  0x18;
                    UCSR1C  =  0x06;
                    UBRR1H  =  0x00;

                    UBRR1L  =  8;

                    while  (1)
                    {
                            data  =  receive();

                            led  =  led;
                            if(data  ==  '1')
                            {
                                    PORTB  =  0x01;
                            }


                            if(data  ==  '2')
                            {
                                    LED  =  0xff;
                            }


                            if(data  ==  '3')
                            {
                                  LED  =  0x00;
                            }


                            if(data  ==  '4')
                            {
                                    PORTB  =0x04;


                            }

                            if(data  ==  '5')
                            {
                                  PORTC  =  0x01;


                            }

                            if(data  ==  '6')
                            {

                                  PORTB  =  0x00;
                                  PORTC  =  0x00;
   239   240   241   242   243   244   245   246   247   248   249