大佬们 我想请问为什么我老是出现一个报错:..\user\includes.h(20): error C231: 'RCLK': redefinition代码示例:
自己定义的文件:
#ifndef _INCLUDES_H_
#define _INCLUDES_H_
#include<reg52.h>
#include<intrins.h>
sbit SRCLK = P3^6;
sbit RCLK = P3^5;
sbit SER = P3^4;
#define GPIO_LIGHT P0
#define GPIO_KEY P1
typedef unsigned char u8;
typedef unsigned int u16;
u8 code smgduan[16] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71};
//共阴数码管
void Hc595SendByte(u8 dat1, u8 dat2);
void Hc595SendByte(u8 dat1, u8 dat2)
{
u8 i;
SRCLK = 1;
RCLK = 1;
for(i = 0; i< 8;i++)
{
SER = dat1>>7;
dat1<<=1;
SRCLK = 0;
_nop_();
_nop_();
SRCLK = 1;
}
for(i = 0; i< 8;i++)
{
SER = dat2>>7;
dat2<<=1;
SRCLK = 0;
_nop_();
_nop_();
SRCLK = 1;
}
RCLK = 0;
_nop_();
_nop_();
RCLK = 1;
}
#endif
我的主函数:
#include"includes.h"
/*
函数名称:主函数
函数功能:运行程序入口
*/
void main()
{
while(1)
{
Hc595SendByte(0xfe,0x01);
}
}
--------------------------------------------------------------------------------------------------------------------------------------------
以下是我买的开发板的原理图:
|