需要仿真图的兄弟姐妹有偿私发
#include<reg51.h> sbit LED=P2^4; sbit k1=P1^7; #include <intrins.h> #define uchar unsigned char #define uint unsigned int uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};//共阳极 sbit EOC=P2^0; sbit OE=P2^1; sbit ST=P2^2; sbit clock=P2^3; sbit ADD_C=P2^5; sbit ADD_B=P2^6; sbit ADD_A=P2^7; sbit dot=P3^7; uint disbuff[4]; uint T; uchar S,M,H; void delay(int x)//延时函数 {
unsigned char a,b; for(a=0;a<x;a++) for(b=0;b<120;b++); }
void T0_clock() interrupt 1 {
clock=~clock; } void init() {
TMOD=0x02; TH0=TL0=236; EA=1;ET0=1;TR0=1;//T0工作方式初值256-20 } //void display0() //数码管显示时钟信号<
|