《按键控制四个数码管显示(共2页).doc》由会员分享,可在线阅读,更多相关《按键控制四个数码管显示(共2页).doc(2页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
精选优质文档-倾情为你奉上#include #include #include #define DUAN XBYTE0xdFFF#define WEI XBYTE0xEFFFunsigned char code table=0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90;#define 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;专心-专注-专业