//uart.h/**********串口端口定義**********/ #define RxD PD0 #define TxD PD1#define baudrate 9600 //波特率 #define F_CPU 8000000UL //定義晶振頻率void uart_init(void) { /*****RS232口線設(shè)置*****/
//delay.h/**********延時函數(shù)*****************/ /*----------------------------------------------- delay_us :1us延時函數(shù) ------------------------------------------------*/ void delay_us(void) { as
#include#include #defineucharunsignedchar #defineuintunsignedint #defineAdd_keyPINC #defineCS_1(PORTB|=(1