《按键控制四个数码管显示1234.doc》由会员分享,可在线阅读,更多相关《按键控制四个数码管显示1234.doc(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-date按键控制四个数码管显示1234按键控制四个数码管显示1234#include #include #include #define DUAN XBYTE0xdFFF#define WEI XBYTE0xEFFFunsigned char code table=0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90;#defin
2、e uint unsigned int#define uchar unsigned charuchar num,a;void delay()uint i,j;for(i=0;i10;i+)for(j=0;j110;j+);void main()WEI=0x01;DUAN=tablea;while(1)P1=0xff;num=P1;num=num|0xf0;while(num!=0xff)delay();num=P1;num=num|0xf0;while(num!=0xff)num=P1;switch(num)case 0xee:a=1;break;case 0xde:a=2;break;case 0xbe:a=3;break;case 0x7e:a=4;break;DUAN=tablea;-