![]() |
發(fā)布時間: 2020-6-19 12:24
正文摘要:報錯warning C318: can't open file 'AT24C02.h' 這是源程序: #include<reg51.h> #include<at24c02.h> #define uchar unsigned char #define uint unsigned int uchar buffer[6]={0}; sbit sda=P3 ... |
lll1472589 發(fā)表于 2020-6-20 11:14 你為什么有兩個聲明51.h,你在定義AT2402.h中是怎么定義的,給你看一下我在定義i2c.h里面寫的內(nèi)容 #ifndef __I2C_H_ #define __I2C_H_ #include<reg51.h> //---重定義關(guān)鍵詞---// #ifndef uchar #define uchar unsigned char #endif #ifndef uint #define uint unsigned int #endif //--定義使用的IO口--// sbit I2C_SCL = P2^1; sbit I2C_SDA = P2^0; //--聲明全局變量--// void I2C_Delay10us(); void I2C_Start(); void I2C_Stop(); uchar I2C_SendByte(uchar dat, uchar ack); uchar I2C_ReadByte(); #endif |
option-c/c++ -include path 里面添加試試 |
你的At24c02 是不是main.c不在一個文件夾啊 |
SKYLAR123 發(fā)表于 2020-6-19 16:17 還是不行,它就變成這個了:智能鎖.c(12): error C309: bad or missing filename |
你把聲明#include<at24c02.h>換成#include "at2402.h"試試 |
Powered by 單片機教程網(wǎng)