用拨码盘做一个记分牌,程序在仿真上不行,求大神指点

2019-07-16 02:54发布

课程设计让用拨码盘做一个记分牌但是我的程序在仿真上不行谁给解决一下
仿真 仿真
程序 程序
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
9条回答
jdxc
2019-07-17 00:58
本帖最后由 jdxc 于 2013-1-5 13:13 编辑
朱枫 发表于 2013-1-5 10:34
我还要花币下载

哦  好像没有办法设置不要币  我没有注意我把代码贴在这谢谢了我把那个图改了一下
#include<reg52.h>
#define uchar unsigned char         
#define uint unsigned int         
sbit r1=P2^0;
sbit r2=P2^1;
unsigned char shuma[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0XD8,0x80,0x90};
uchar code boma[]={0xff,0xf7,0xfb,0xfd,0xfe,0xfa,0xf5,0xf6,0xf7,0xf8,0xf9};
main()
{  uchar i;
   r1=0,r2=0;
   P0=0xc0;
  while(1)
  {
   r1=1;r2=0;
   P1=0xff;
   if (P1==boma)
      P0=shuma;
   r1=0;r2=1;
   P3=0xff;
   if (P3==boma)
      P0=shuma;
  }
}




电路图

电路图

一周热门 更多>