单片机模块化编程各个头文件如何互加?下面是我编写的一个程序的一部分,哪里出错了?为啥在key中打不开? 10
文件名write_com.h#include"delay.h"#ifndef_write_com_h_#define_write_com_h_voidwrite_com(...
文件名write_com.h
#include "delay.h"
#ifndef _write_com_h_
#define _write_com_h_
void write_com(uchar);
#endif
文件名write_com.c
#include"write_com.h"
void write_com(uchar com)
{
lcdrs=0;
P0=com;
lcdrw=0;
delay(5);
lcden=1;
delay(5);
lcden=0;
}
文件名keyscan.h
#include"delay.h"
#include"write_com.h"
#include"write_date.h"
#include"write_sfm.h"
#ifndef _keyscan_h_
#define _keyscan_h_
void keyscan();
#endif 展开
#include "delay.h"
#ifndef _write_com_h_
#define _write_com_h_
void write_com(uchar);
#endif
文件名write_com.c
#include"write_com.h"
void write_com(uchar com)
{
lcdrs=0;
P0=com;
lcdrw=0;
delay(5);
lcden=1;
delay(5);
lcden=0;
}
文件名keyscan.h
#include"delay.h"
#include"write_com.h"
#include"write_date.h"
#include"write_sfm.h"
#ifndef _keyscan_h_
#define _keyscan_h_
void keyscan();
#endif 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询