*** WARNING L5: CODE SPACE MEMORY OVERLAP FROM: 000BH TO: 000DH Program Size: data=14.0 xdata=0 code=201 Target not created 程序是静态显示123456在6个LED管上面。。 #include "reg51.h" #define uchar unsigned char uchar count,dunum,wenum; sbit dula=P2^6; sbit wela=P2^7; uchar code tabledu[]={ 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; uchar code tablewe[]= {0xfe,0xfd,0xfb,0xf7,0xef,0xdf}; display(); void main() { EA=1; ET0=1; TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; TR0=1; while (1) { if(count==20) { count=0; if(dunum==6) dunum=0; if(wenum==6) wenum=0; display(); dunum++; wenum++; } } } void Timer0() interrupt 1 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; count++; } display() { P0=0xff; wela=1; wela=0; P0=tabledu[dunum+1]; dula=1; dula=0; P0=tablewe[wenum]; wela=1; wela=0; } |