1、#include#include#define uint unsigned int #define uchar unsigned charuchar z=50,e=0x00,f=0xff;uchar code table1= 0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff;uchar code table2=0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00;uchar code table3=0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff;uchar code table4=0xe7,0xdb,0xb
2、d,0x7e,0xbd,0xdb,0xe7,0xff;uchar code table5=0xe7,0xc3,0x81,0x00,0x81,0xc3,0xe7,0xff;uchar code table6=0x7e,0x3c,0x18,0x00,0x18,0x3c,0x7e,0xff;void delay(uchar); void lsd1(); void lsd2(); void lsd3();void lsd4(); void lsd5();void lsd6();void lsd7(); void lsd8();void lsd9(); void lsd10(); void lsd11(
3、);void lsd12();main()while(1) lsd1(); lsd2();lsd3(); lsd4();lsd5(); lsd6(); lsd7();lsd8();lsd9();lsd10(); lsd11(); lsd12(); void delay(uchar x) /延时函数uint i,j;for(i=x;i0;i-)for(j=250;j0;j-); void lsd1() /lsd1 单个流水灯双程模式 1uchar a,i,j,k,l,l1,k1,j1,i1;a=0xfe;P0=a;delay(z);for(i=0;i1;P1=a;delay(z);for(l1=0;l11;P2=a;delay(z);for(j=0;j1;P1=a;delay(z);for(l=0;l1;P3=a;for(k1=0;k11;P0=a;delay(z);for(i1=0;i11;P2=a;P3=a;delay(z);for(k=0;k8;k+)P2=table3k;P3=table3k;delay(z);for(l=0;l8;l+)P0=table1l;P1=table1l;delay(z);while(1);