| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 819 人关注过本帖
标题:大家帮我看下这个程序哪错了?
取消只看楼主 加入收藏
C帅
Rank: 1
等 级:新手上路
帖 子:56
专家分:7
注 册:2010-1-5
结帖率:55.56%
收藏
 问题点数:0 回复次数:1 
大家帮我看下这个程序哪错了?
#include<reg52.h>
#define uc unsigned char
#define ui unsigned int
uc code tabledub[]={~0x3F,~0x06,~0x5B,~0x4F,~0x66,~0x6D,
~0x7D,~0x07,~0x7F,~0x6F,~0x77,~0x7C,~0x39,~0x5E,~0x79,~0x71};
uc b,temp,b1;
void delay(uc x)
{
    ui y;
    for(;x!=0;x--)
        for(y=1100;y>0;y--);     
}
uc keyscan();
main()
{
    while(1)
    {   
         b1=keyscan();
        P3=tabledub[b1];
    }
}uc keyscan();
{
        P3=0xfd;
        temp=P3;
        temp=temp&0xf0;
        while(temp!=0xf0)
        {
            delay(3);
            while(temp!=0xf0)
            {
                temp=P3;
                switch(temp)
                {
                    case 0xed:b=0;
                        break;
                    case 0xdd:b=1;
                        break;
                    case 0xbd:b=2;
                        break;
                    case 0x7d:b=3;
                        break;
                }
//                P1=tabledub[b];
                temp=temp&0xf0;
            }
//            temp=temp&0xf0;            
        }   
        P3=0xfb;
        temp=P3;
        temp=temp&0xf0;
        while(temp!=0xf0)
        {
            delay(3);
            while(temp!=0xf0)
            {
                temp=P3;
                switch(temp)
                {
                    case 0xeb:b=4;
                        break;
                    case 0xdb:b=5;
                        break;
                    case 0xbb:b=6;
                        break;
                    case 0x7b:b=7;
                        break;
                }        
//                P1=tabledub[b];
                temp=temp&0xf0;
            }
//            temp=temp&0xf0;
        }
        P3=0xf7;
        temp=P3;
        temp=temp&0xf0;
        while(temp!=0xf0)
        {
            delay(3);
            while(temp!=0xf0)
            {
                temp=P3;
                switch(temp)
                {
                    case 0xe7:b=8;
                        break;
                    case 0xd7:b=9;
                        break;
                    case 0xb7:b=10;
                        break;
                    case 0x77:b=11;
                        break;
                }
//                P1=tabledub[b];
                temp=temp&0xf0;
            }
//            temp=temp&0xf0;   
        }
    return b;
}
结果显示有错误,点击错误提示老弹出“.......包含不可用路径”这是怎么回事?
2011-02-06 02:10
C帅
Rank: 1
等 级:新手上路
帖 子:56
专家分:7
注 册:2010-1-5
收藏
得分:0 
嗯,后来也没出现那情况了~~~纠结啊,都不知道为啥会出现那情况呢``````
2011-02-20 22:10
快速回复:大家帮我看下这个程序哪错了?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027654 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved