oid main()
{
uchar Temp;
direction=0; //方向
openflag=0; //啟動標志
while(1)
{
Temp=KeyScan();
switch(Temp) //按鍵處理
{
case 0x0e:
openflag=!openflag;
break;
case 0x0d:
if(speed<9)
speed++; //速度加
break;
case 0x0b:
if(speed>0)
speed--; //速度減
break;
case 0x07:
direction=!direction; //方向取反
break;
}
DigDisplay(); //顯示
if(openflag)
{
Motor(); //步進電機
}
}
}
164807tlpllesl8u08u0ne.png (70.1 KB, 下載次數(shù): 160)
790.79 KB, 下載次數(shù): 102, 下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/) | Powered by Discuz! X3.1 |