=======================Р//函数名称:向串口发送一个字符Р//=============================================Р(unsignedcharch)Р{Р SBUF=ch;Р while(TI==0);Р TI=0;Р}Р//定义花样数据Рcode unsignedchardesignР[32]={0xFF,0xFE,0xFD,Р0xFB,0xF7,0xEF,0xDF,0xBF,0x7f,Р0x7f,0xbf,0xdf,0xef,0xF7,0xFB,0xFD,0xFE,0xFF,Р0XFF,0xFE,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x0,Р0xE7,0xDB,0xBD,0x7E,0xFF};Р//=============================================Р//函数名称:MAINР//=============================================Рvoidmain()Р{Р unsigned char b;//在 C51 中因内存由限需要尽可能考虑使用变量的类型Р//Reset_Vtrip();Р//delay1ms(60000);Р//CS=0;Р Writer_to_X5045(ID_Part_D,ID_Part_A);Р Write_StateReg(0X10);Р ();Р while(1)Р {Р for(b=0;b<32;b++)Р {Р// Set_Vtrip();Р P0=design[b];//读已经定义的花样数据并写花样数据到 P0;Р (Read_StatusReg());Р (Read_form_X5045(ID_Part_A));Р Rest_WDG();Рdelay1ms(300);Р }Р }Р}