為什么步進(jìn)電機(jī)正轉(zhuǎn)和反轉(zhuǎn)速度不一樣?
- 我寫的一個(gè)C51小程序 #include unsigned char code Forward[4]={0xf1,0xe9,0xe5,0xe3}; unsigned char code Back[4]={0xf1,0xe3,0xe5,0xe9}; unsigned char flag=0; void delay(unsigned int cnt) { while(--cnt); } void main() { unsigned char i; if(flag==0) { for(i=0;i<=4;i++) { P1=Forward[i]; delay(500); } } else { for(i=0;i<=4;i++) { P1=Back[i]; delay(500); } } } 倘若修改flag的初值,應(yīng)該說(shuō)會(huì)改變步進(jìn)電機(jī)的轉(zhuǎn)向,可是為什么flag=0和1時(shí)步進(jìn)電機(jī)轉(zhuǎn)速不同???
-
問(wèn)
提問(wèn)者:網(wǎng)友
2018-08-18