【简答题】
观察图1所示电路,P0、 P1和P2口各接1个数码管,分析下列C51程序实现的功能。 (5分) #include
#define uchar unsigned char uchar codeDSY_CODE[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uchar Count=0; sbit K2=P3^6; void Show_Count ( ) { P0=DSY_CODE[Count/100]; P1=DSY_CODE[Count%100/10]; P2=DSY_CODE[Count%10]; } voidmain() { P0=0x00; P1=0x00; P2=0x00; IE=0x81; // 允许 INT0 中断 IT0=1; // 下降沿触发 while(1) { if(K2==0) Count=0; Show_Count ( ); } } void EX_INT0( )interrupt 0 { Count++; } 程序实现的功能是:
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
收藏
举报
参考答案:
参考解析: