#include#include#include#define uchar unsigned char#define uint unsigned int#define TimeDelay 60000void delay(uint n);void Flash0a(void);void Flash0b(void);void Flash1a(void);void Flash1b(void);void Flash2a(void);void Flash2b(void);void Flash3a(void);void Flash3b(void);/*************************************************************Function: 主函數(shù)*parameter:*Return:*Modify:*************************************************************/void main(void){while(1){Flash1b();Flash1a();delay(TimeDelay);delay(TimeDelay);Flash0b();Flash0a();Flash2b();Flash2a();Flash1b();Flash1a();Flash3b();Flash3a();}}/*************************************************************Function: 延時*parameter:*Return:*Modify:*************************************************************/void delay(uint n){while(n!=0){n--;}}void Flash0a(void){uchar i;uchar Temp;Temp = 0x80;for(i=0;i<8;i++){P0 = ~Temp;delay(TimeDelay);Temp = Temp >> 1;}P0 = 0xff;}void Flash0b(void){uchar i;uchar Temp;Temp = 0x80;for(i=0;i<8;i++){P0 = Temp; delay(TimeDelay);Temp = Temp >> 1;}P0 = 0;}void Flash1a(void){uchar i;uchar Temp;P1 = 1;Temp = 0x80;for(i=0;i<8;i++){P1 = ~Temp;delay(TimeDelay);Temp = Temp >> 1;}P1 = 0xff;}void Flash1b(void){uchar i;uchar Temp;P1 = 1;Temp = 0x80;for(i=0;i<8;i++){P1 = Temp; delay(TimeDelay);Temp = Temp >> 1;}P1 = 0;}void Flash2a(void){uchar i;uchar Temp;P2 = 1;Temp = 0x80;for(i=0;i<8;i++){P2 = ~Temp;delay(TimeDelay);Temp = Temp >> 1;}P2 = 0xff;}void Flash2b(void){uchar i;uchar Temp;P2 = 1;Temp = 0x80;for(i=0;i<8;i++){P2 = Temp; delay(TimeDelay);Temp = Temp >> 1;}P2 = 0;}void Flash3a(void){uchar i;uchar Temp;P3 = 1;Temp = 0x80;for(i=0;i<8;i++){P3 = ~Temp;delay(TimeDelay);Temp = Temp >> 1;}P3 = 0xff;}void Flash3b(void){uchar i;uchar Temp;P3 = 1;Temp = 0x80;for(i=0;i<8;i++){P3 = Temp; delay(TimeDelay);Temp = Temp >> 1;}P3 = 0;}
評論