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

return 0;
            }


            NDsocket_serial_test_RX.c

            #include <avr/io.h>
            #include <util/delay.h>


            char rx;
            unsigned char toggle = 0;
            void Putch(char data)

            {
                    UDR0 = data;
                    while(!(UCSR0A & (1<<TXC0)));



                    if(toggle == 0)
                    {
                            PORTB = 0b00000001;
                            toggle = 1;
                    }
                    else

                    {
                            PORTB = 0x00;
                            toggle = 0;
                    }

                    //return UDR;
            }


            char Getch(void)
            {
                    while(!(UCSR0A & 0x80));

                    return UDR0;
            }


            void init_uart(void)



            {




                                                         -  991  -
   993   994   995   996   997   998   999   1000   1001   1002   1003