📄 demo1.cpp
字号:
#include <conio.h>
#include <iostream.h>
#include "driver.h"
void main()
{
clrscr();
InitialBoard();
ShiftPulseOut(2);
// 定速+x方向定量驱动
SetR(1, 8000000);
SetSV(1, 980);
SetV(1, 980);
SetP(1, 2500);
Command(1, DRIVE_P);
cout << "Const speed drive +x..." << endl;
WaitForStop(1);
// 定速-y方向定量驱动
SetR(2, 8000000);
SetSV(2, 980);
SetV(2, 980);
SetP(2, 2000);
Command(2, DRIVE_N);
cout << "Const speed drive -y..." << endl;
WaitForStop(2);
// 定速-x方向连续驱动
Command(1, DRIVE_CN);
cout << "Continue const speed drive -x..." << endl;
cout << "Please press any key to stop." << endl;
getch();
Command(1, STOP_D);
// 定速+y方向连续驱动
Command(2, DRIVE_CP);
cout << "Continue const speed drive +y..." << endl;
cout << "Please press any key to stop." << endl;
getch();
Command(2, STOP_D);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -