打印

新手求大神指导!!

[复制链接]
1902|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
shiyiye|  楼主 | 2013-3-22 10:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
使用MPLAB8.7 Hi-TECH9.81编译器。PIC16F1827芯片。出现了以下错误
Error   [1098] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 103.7 conflicting declarations for variable "TRISB1" (D:\Program Files\HI-TECH Software\PICC\9.81\include\pic16f1827.h:601)
Warning [374] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 104.7 missing basic type; int assumed
Error   [984] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 104.7 type redeclared
Error   [1098] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 104.7 conflicting declarations for variable "ANSELA" (D:\Program Files\HI-TECH Software\PICC\9.81\include\pic16f1827.h:1480)
Warning [374] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 105.6 missing basic type; int assumed
Error   [984] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 105.6 type redeclared
Error   [1098] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 105.6 conflicting declarations for variable "ANSB1" (D:\Program Files\HI-TECH Software\PICC\9.81\include\pic16f1827.h:1509)
Warning [374] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 106.7 missing basic type; int assumed
Error   [984] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 106.7 type redeclared
Error   [1098] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 106.7 conflicting declarations for variable "ADCON1" (D:\Program Files\HI-TECH Software\PICC\9.81\include\pic16f1827.h:1004)
Error   [194] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 107.7 ")" expected
Error   [984] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 107.9 type redeclared
Error   [1098] F:\aBiShe\chengxu\HI_TECH\chengxu.c; 107.9 conflicting declarations for variable "delay" (F:\aBiShe\chengxu\HI_TECH\chengxu.c:83)

对应的程序是这样的

void ad_init();//采集端口
{
        TRISA=0x18;//0b00011000设置RA3,RA4为输入AN3,AN4(AD采集端口)
        TRISB1=1;//设置RB1为输入 AN11
        ANSELA=0x18;
        ANSB1=1;
        ADCON1=0X90;
        delay(1);
}
void delay(uint x)//5ms延时函数
{
        uint y,k;
        for(y=0;y<x;y++)
                for(k=0;k<200;k++);
}
重新创建一个工程,单独调用这俩个子函数,却可以编译成功。
这是哪里出问题了???求大神指导

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝