完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
#include #include #define uchar unsigned char #define uint unsigned int ***it key1=P0^1; //显示‘1’按下 ***it key2=P0^3; //显示‘2’按下 ***it key3=P0^5; //显示‘3’按下 ***it key4=P0^7; //显示‘4’按下 ***it over=P2^0; //结束标志 #define temp1 1 #define temp2 2 #define temp3 3 #define temp4 4 uchar c,count,count1,count2,temp,num; uchar code table[]={ 0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; //数码管显示 void delayms(uchar xms) //延时函数 { uchar i,j; for(i=xms;i>0;i--) for(j=110;j>0;j--); } void c_to_port(uchar c) //发送单个字符 { SBUF=c; while(ti==0); TI=0; } void s_to_port(uchar *s) //发送字符串 { while(*s!=' |