⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 这是凌阳16位单片机做小车的完全代码和电路图
💻 C
字号:
//======================================================
//  The information contained herein is the exclusive property of
//  Sunnnorth Technology Co. And shall not be distributed, reproduced,
//  or disclosed in whole in part without prior written permission.
//  (C) COPYRIGHT 2003  SUNNORTH TECHNOLOGY CO.
//  ALL RIGHTS RESERVED
//  The entire notice above must be reproduced on all authorized copies.
//========================================================

//========================================================
//  工程名称:	ex1
//  功能描述:	实现小车的前进功能
//  涉及的库:	无
//  组成文件:	main.c
//	硬件连接:	见语音控制小车说明书
//	维护记录:	2005-9-11 v1.0
//========================================================

#define	P_IOB_Data			(unsigned int *)0x7005
#define	P_IOB_Dir			(unsigned int *)0x7007
#define	P_IOB_Attrib		(unsigned int *)0x7008
#define	P_Watchdog_Clear	(unsigned int *)0x7012

//=============================================================
// 语法格式:	int main(void);
// 实现功能:	主函数
// 参数:		无
// 返回值:		无
//=============================================================

int main(void)
{
 	*P_IOB_Dir = 0xffff;
 	*P_IOB_Attrib = 0xffff;			//设置IOB为同相输出

	*P_IOB_Data = 0x2800;			//前进

	while(1)
	{		
		*P_Watchdog_Clear = 0x0001;	//清看门狗 
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -