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

📄 demo3.cpp

📁 这是在windows环境下用VC开发的MCX运动控制芯片的演示程序
💻 CPP
字号:
#include <conio.h>
#include <iostream.h>
#include "driver.h"

void main()
{
	clrscr();
	InitialBoard();
	ShiftPulseOut(2);

	// 两轴直线插补
	SetR(1, 8000000);
	SetA(1, 320);
	SetSV(1, 500);
	SetV(1, 5000);
	SetP(1, 10000);
	SetP(2, -10000);
	Command(AXIS_XY, ENABLE_D);	// 减速有效
	Command(AXIS_XY, CMD_LINE);
	cout << "LINE Interpolation" << endl;
	getch();

	// 两轴圆弧插补
	EnableCSpeed();
	SetR(1, 4000000);
	SetR(2, 5656000);
	SetSV(1, 1000);
	SetV(1, 1000);
	SetC(1, 3000);
	SetC(2, 0);
	SetP(1, 0);
	SetP(2, 0);
	Command(AXIS_XY, CMD_CW);
	cout << "CW Interpolation" << endl;
	getch();

	// 梯形加减速两轴圆弧插补
	EnableManu(AXIS_XY);
	SetR(1, 2000000);
	SetA(1, 130);
	SetSV(1, 125);
	SetV(1, 5000);
	SetC(1, -10000);
	SetC(2, 0);
	SetP(1, 0);
	SetP(2, 0);
	SetDP(1, 53493);
	EnableDecAcc(AXIS_XY);
	Command(AXIS_XY, CMD_CCW);
	cout << "CCW Interpolation" << endl;
	getch();
}

⌨️ 快捷键说明

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