#include
#include#define uchar unsigned charsbit P2_1=P2^1; //界说数码管位码端口sbit P2_2=P2^2;sbit P2_3=P2^3;sbit OE=P3^0; //界说ADC0808端口sbit EOC=P3^1;sbit ST=P3^2;sbit P3_4=P3^4;sbit P3_5=P3^5;sbit P3_6=P3^6;uchar code leddata_dot[]={0x40,0x79,0x24,0x30,0x19,0x12};//带小数点的0~5六个uchar code leddata[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};//共阳极0~9十个段码/段码//*********************************//延时子程序//*********************************void delay(uchar n){ uchar i,j;for(i=0;i