下載手機汽配人

51單片機控制步進電機和直流電機的問題

誰有關于這方面的資料,最好帶有程序解釋。 滿意加分!
提問者:網(wǎng)友 2018-07-27
最佳回答
我就不說沒用的 直接程序 當然還有其他的程序 有需要再要。。。 #include "reg52.h" void delay(); //Motor sbit F1 = P1^0; sbit F2 = P1^1; sbit F3 = P1^2; sbit F4 = P1^3; unsigned char code FFW[8]={0xfe,0xfc,0xfd,0xf9,0xfb,0xf3,0xf7,0xf6}; //反轉(zhuǎn) unsigned char code FFZ[8]={0xf6,0xf7,0xf3,0xfb,0xf9,0xfd,0xfc,0xfe}; //正轉(zhuǎn) unsigned int K, rate; void motor_ffw() { unsigned char i; for (i=0; i<8; i++) //一個周期轉(zhuǎn)30度 { P1 = FFW[i]&0x1f; //取數(shù)據(jù) delay(); //調(diào)節(jié)轉(zhuǎn)速 } } void delay() { unsigned int k,t; t=rate; while(t--) { for(k=0; k<150; k++) { } } }
回答者:網(wǎng)友
產(chǎn)品精選
搜索問答
還沒有汽配人賬號?立即注冊

我要提問

汽配限時折扣

本頁是網(wǎng)友提供的關于“51單片機控制步進電機和直流電機的問題”的解答,僅供您參考,汽配人網(wǎng)不保證該解答的準確性。