| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 482 人关注过本帖
标题:一直在努力,求赐教
取消只看楼主 加入收藏
我的世界123
Rank: 1
等 级:新手上路
帖 子:43
专家分:1
注 册:2013-10-14
结帖率:81.82%
收藏
 问题点数:0 回复次数:0 
一直在努力,求赐教
#include<reg51.h>
#define uchar unsigned char
#define uint  unsigned int                                                
sbit s1=P2^4;
sbit s6=P2^3;
sbit s2=P2^2;
sbit s3=P2^1;
sbit s4=P2^0;
sbit s5=P0^4;
sbit key0=P0^0;
sbit key1=P0^1;
sbit key2=P0^2;
sbit key3=P0^3;
void KEY_Init(void);
delay1s(uint x)
{uchar n;
 while(x--)
   {for(n=0;n<125;n++);}
}
main()
{
   if(key3==1)
    if(s1==0)
     if(key0==0){goto loop1;}
     else
         ;
   else
   {
        if(extern key0 SwitchFlagshort==0){goto loop2;}
        else
           ;
         if(extern key0 SwitchFlaglong==0){goto loop3;}
         else
            ;
    }
loop:s1=1;
     s3=1;
     delay1s();
     P2=0xff;
loop2:s1=1;
      s3=1;
      delay1s();
      P2=0xff;
loop3:s1=0;
     else
         if(s1==0)
          if(extern key0 SwitchFlagshort==0){goto loop4;}
          else
             ;
           if(extern key0 SwitchFlaglong==0){goto loop5;}
           else
              ;
         else
           if(extern key0 SwitchFlagshort==0){goto loop6;}
           else
              ;
           if(extern key0 SwitchFlaglong==0){goto loop7;}
           else
              ;
loop4:s1=1;
loop5:s3=1;
      delay4s();
      P2=0xff;
loop6: ;
loop7:s1=1;
      delay3s();
      P2=oxff;
      s3=1;
      delay4s();
      P2=0xff;
      if(key3==0||s1==1){s4=1;}
      else
         s4=0;
      if(s1==0&extern key2 Reset1Flagshort==0)
       s1=0;
       delay1s();
       s1=1;
      else
         ;
      if(s1==0&&extern key2 Reset1Flaglong==0)
       s6=1;
       delay3s();
       P2=0xff;
      else
         ;
      if(key3==0&key1==0)
       {
         s2=1;
         delay1s();
         P2=0xff;
       }
      else
       {
          ;
       }
}


compiling 456.c...
456.C(29): error C141: syntax error near 'extern'
456.C(32): error C141: syntax error near 'extern'
456.c - 2 Error(s), 0 Warning(s).
不知哪里错了,求赐教
搜索更多相关主题的帖子: include 
2013-10-30 17:02
快速回复:一直在努力,求赐教
数据加载中...
 
   



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

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