原来搞了一段时间,但看不到什么市场,就不搞了 学习了{:smile:} 本帖最后由 pisayisi 于 2012-12-4 20:14 编辑
if you simply use delays with systick and ios you can use the code shown attachmetn for stm32f1xx. Otherwiseyou must use 2 timers and two ios as shown below...
u32 FFW={0xfffe,0xfffc,0xfffd,0xfff9,0xfffb,0xfff3,0xfff7,0xfff6}; //·´×ª
u32 FFZ={0xfff6,0xfff7,0xfff3,0xfffb,0xfff9,0xfffd,0xfffc,0xfffe}; //Õıת
voidmotor_ffw()
{
u8 i;
u8j;
for (j=0; j<12; j++) //ת1*nȦ
{
for (i=0; i<8; i++) //Ò»¸öÖÜÆÚת30¶È
{
GPIO_Write(GPIOD,FFW); //È¡Êı¾İ
Delay(2); //µ÷½ÚתËÙ ,ÑÓʱԽ³¤£¬×ªËÙÔ½¿ì
Delay(1);
}
}
}
voidmotor_ffz()
{
u8 i;
u8 j;
for (j=0; j<12; j++) //ת1*nȦ
{
for (i=0; i<8; i++) //Ò»¸öÖÜÆÚת30¶È
{
GPIO_Write(GPIOD,FFZ);
Delay(2); //µ÷½ÚתËÙ
Delay(1);
}
}
} 正在学习,参观下
页:
[1]