lll1472589 发表于 2020-6-20 11:14 你为什么有两个声明51.h,你在定义AT2402.h中是怎么定义的,给你看一下我在定义i2c.h里面写的内容 #ifndef __I2C_H_ #define __I2C_H_ #include<reg51.h> //---重定义关键词---// #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 发表于 2020-6-19 16:17 还是不行,它就变成这个了:智能锁.c(12): error C309: bad or missing filename |
你把声明#include<at24c02.h>换成#include "at2402.h"试试 |