#include<reg52.h> #define DataPort P0; sbit LATCH1=P2^2; sbit LATCH2=P2^3; unsigned char weima[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf}; unsigned char duanma[]={0x6D,0x5B,0x06,0x06,0x4F,0x06,0x66,0x30,0x38,0x3F,0x3E,0x7B,0x3E}; void delay(unsigned char t); main() { unsigned char i; while(1) { for(i=0;i<7;i++) { P0=weima[i]; LATCH2=1; LATCH2=0; P0=duanma[i]; LATCH1=1; LATCH1=0; delay(20000); } } } void delay(unsigned char t) { while(--t); } |