main.c

来自「用陵阳61板改装玩具机器人的全套资料」· C语言 代码 · 共 54 行

C
54
字号
extern void Robot_LeftLegGo(unsigned int n);
extern void Robot_LeftLegBack(unsigned int n);
extern void Robot_RightLegGo(unsigned int n);
extern void Robot_RightLegBack(unsigned int n);
extern void Robot_Light(unsigned int n);
extern void Robot_DanceAgain(unsigned int n);
extern void Robot_Dance(unsigned int n);
extern void Robot_Go(unsigned int n);
extern void Robot_Backup(unsigned int n);
extern void Robot_TurnLeft(unsigned int n);
extern void Robot_TurnRight(unsigned int n);
extern void Robot_HeadTurnLeft(unsigned int n);
extern void Robot_HeadTurnRight(unsigned int n);

extern void Delay(unsigned int);
extern void Set_IOB_Bit(unsigned int,unsigned int,unsigned int
						,unsigned int,unsigned int);

int main(void)
{
	while(1)
	{
		Robot_LeftLegGo(600);
		Delay(500);
		Robot_LeftLegBack(600);
		Delay(500);
		Robot_RightLegGo(600);
		Delay(500);
		Robot_RightLegBack(600);
		Delay(500);
		Robot_Light(600);
		Delay(500);
		Robot_Dance(2);
		Delay(500);
		Robot_DanceAgain(2);
		Delay(500);
		Robot_Go(2);
		Delay(500);
		Robot_Backup(2);
		Delay(500);
		Robot_TurnLeft(2);
		Delay(500);
		Robot_TurnRight(2);
		Delay(500);
		Robot_HeadTurnLeft(2);
		Delay(500);
		Robot_HeadTurnRight(2);
		Delay(500);
	}
	while(1)
	{
		*(unsigned int *)0x7012 = 1;
	}
}

⌨️ 快捷键说明

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