VR2YIN 發表於 28-9-2015 20:04
只想做到按不同鍵,步進電機做不同動作後停下。
delete the P2=0xff
At the end of every if command, please add pin high to reset the Rx circuit.
I think it is final version. ^_^
Suggestion too.
感謝啊!!! VR2YIN 發表於 28-9-2015 20:04
只想做到按不同鍵,步進電機做不同動作後停下。
while(1)
{
//delete p2=0xff
dat=(P2 & 0x0f); //00001111
if(dat==0x08) //先按A 顯示1 燈亮 通道 開 0000 1000
{
int i;
P0=tab; //數碼顯示
P1=0xfe; //1111 1110
P24=0; //燈亮
for(i=0;i<200;i++) //--------------!!! 想行200次就停止,但不成功 !!!!
Move();
while (P2 & 0x08) //add this while instruction (I think)
{
}
} OK!!!回到家測試!!! 謝謝!!! 太感謝XPO指導,做到了效果了!
我會好好再理解當中迴圈問題!!!
再一次感謝,花了寶貴的時間幫忙啊!!!{:soso_e154:} 本帖最後由 VR2YIN 於 29-9-2015 22:26 編輯
會努力再優化線路及代碼程序!!!
-X2Nl_mPkc4
JSiSzj9E3l4
修改後做到效果了!!!
頁:
1
[2]