说明:连接的管脚为P1.5
#include "reg52.h" //此文件中定义了单片机的一些特殊功能寄存器
typedef unsigned int u16; //对数据类型进行声明定义
typedef unsigned char u8;
sbit beep=P1^5;
void delay(u16 i)
{
while(i--);
说明:连接的管脚为P1.5
#include "reg52.h" //此文件中定义了单片机的一些特殊功能寄存器
typedef unsigned int u16; //对数据类型进行声明定义
typedef unsigned char u8;
sbit beep=P1^5;
void delay(u16 i)
{
while(i--);