?? turn.c
字號:
#include <spce061a.h>
void zhengz1() //左邊的單步距正轉
{
*P_IOB_Data&=0xf3ff; //B10為左邊DIR=0 B11為左邊的PLS=0
*P_IOB_Data|=0x0800; //B10為左邊DIR=0 B11為左邊的PLS=0
}
void fanz1() ////左邊的單步距反轉
{
*P_IOB_Data|=0x0c00; //B10為左邊DIR=1 B11為左邊的PLS=1
*P_IOB_Data&=0xfbff; //B10為左邊DIR=1 B11為左邊的PLS=0
}
void up()
{
int i;
for(i=0;i<200;i++)
{
*P_IOB_Data&=0xf3ff; //B10為左邊DIR=0 B11為左邊的PLS=0
*P_IOB_Data|=0x0800; //B10為左邊DIR=0 B11為左邊的PLS=0
}
}
void down()
{
int i;
for(i=0;i<50;i++)
{
*P_IOB_Data|=0x0c00; //B10為左邊DIR=1 B11為左邊的PLS=1
*P_IOB_Data&=0xf7ff; //B10為左邊DIR=1 B11為左邊的PLS=0
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -