• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

单片机C语言代码出现未解析的外部符号

hehexi 2021-03-30 浏览量:892
#define __mimasuo_h
sbit pa0=P2^0;
sbit pa1=P2^1;
sbit pa2=P2^2;
sbit pa3=P2^3;
sbit pa4=P2^4;
sbit col0=P3^0;
sbit col1=P3^1;
sbit col2=P3^2;
sbit col3=P3^3;
sbit col4P3^4;.
sbit led =P5^5;

void main()
{
        
        led=0;        
        while(1)
        {
                        ;                        
        }               
}
void coded_lock(void);
u8 ajz=0;
u8 fori;
u8 forj;
u8 fork;
u8 forl;
u8 zq;
u8 zqz;
u8 numa;
u8 cw=0;
u8 num_before = 0;
extern u8 tuige;
//extern u8 tuiges;
extern u8 quxiao;
extern u8 num;
extern u8 zhi;
extern u8 state;
extern u8 anxia;
extern u8 queding;

u8 enter[6]={0};//输入密码数组
u8 correct[]={990505};//正确密码
u8 b1[6]= {990505};//"990505";

void coded_lock(void)
{
        //EEPROM_WriteBytes(b106);
        numa=num-1;
        if(num<7)
{        
                if(anxia==1)
        {
                anxia=0;
                        if(zhi<10)
                {        
                        enter[numa]=zhi;
                        if(num==6)
                        {                                
                                num=0;
                                for(fori=0;fori<6;fori++)
                                {
                                        if(enter[fori]==correct[fori])
                                        {
                                                zq++;
                                                if(zq==6)
                                                {
                                                        zq=0;                                                                                                                                                               
                                                        dks_kai();                                                        
                                                        for(forl=0;forl<6;forl++)
                                                        {
                                                                enter[forl]=0;
                                                        }
                                                
                                                }
                                        }
                                        else
                        {
                                  zq=0;
                                  cw=1;
                                  for(forj=0;forj<6;forj++)
                                 {
                                         enter[forj]=0;
                                 }
                          }
                         }                                       
                        }
                 }
                if(tuige==1)//退格
                                {
                                        if(numa<6)
                                        {                                                
                                                tuige=0;                                                                                                
                                                enter[numa]=0;
                                                num-=1;                                                
                                        }
                                }        if(num != num_before)
          }

        }
}
mg id="aimg_kw59D" onclick="zoom(this this.src 0 0 0)" class="zoom" onmouseover="img_onmouseoverfunc(this)" data-ke-onload="thumbImg(this)" alt="" border="0">
#endif

0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
最佳答案
  • 应该是你的程序中加上了中文的字符了吧,中文的空格,分号,之类的
    • 发布于 2021-04-02
    • 举报
    • 评论 0
    • 0
    • 0

其他答案 数量:4
  • 你把具体报错贴出来,程序上看不出问题
    • 发布于2021-03-30
    • 举报
    • 评论 0
    • 0
    • 0

  • 应该是有变量没有定义就使用了,需要你提供具体的MDK提示的。
    • 发布于2021-03-31
    • 举报
    • 评论 0
    • 0
    • 0

  • 这个光贴部分程序,没有环境报错信息,很不好定位啊。


    • 发布于2021-03-31
    • 举报
    • 评论 0
    • 0
    • 0

  • 出错信息是什么啊,这程序哪看得出来是哪里有错啊
    • 发布于2021-04-08
    • 举报
    • 评论 0
    • 0
    • 0

相关问题

问题达人换一批

单片机C语言代码出现未解析的外部符号