|
大家帮忙!51+L298+步进电机!为什么不转圈?
[复制链接]
电路图
程序代码
#include
#include "18b20.h"
sbit P10 = P1^0;
sbit P11 = P1^1;
sbit P12 = P1^2;
sbit P13 = P1^3;
sbit P14 = P1^4;
sbit P15= P1^5;
void Delay_50ms(unsigned int aiDelay)
{
unsigned int i= 0;
for(; aiDelay> 0; aiDelay--)
{
for( ; i< 6245; i++)
{
;
}
}
}
void main()
{
while(1)
{
P12 = 1;
P13 = 1;
P14 = 1;
P15 = 0;
Delay_50ms(20);
P12 = 1;
P13 = 1;
P14 = 0;
P15 = 1;
Delay_50ms(20);
P12 = 1;
P13 = 0;
P14 = 1;
P15 = 1;
Delay_50ms(20);
P12 = 0;
P13 = 1;
P14 = 1;
P15 = 1;
Delay_50ms(20);
}
}
不知道那里出错了,请大家帮忙看看,在下感激不尽
[ 本帖最后由 chary8088 于 2009-6-29 09:55 编辑 ]
|
|