完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
/**********************电机正反转*******************************************/ void Motor_GO(void) //电机正转函数,即开 { if((count0>0)&&(count0<=3)) { A_Phase=1;B_Phase=0;C_Phase=0;D_Phase=0; } if((count0>3)&&(count0<=6)) { A_Phase=0;B_Phase=1;C_Phase=0;D_Phase=0; } if((count0>6)&&(count0<=9)) { A_Phase=0;B_Phase=0;C_Phase=1;D_Phase=0; } if((count0>9)&&(count0<=12)) { A_Phase=0;B_Phase=0;C_Phase=0;D_Phase=1; } if(count0>12) { A_Phase=0;B_Phase=0;C_Phase=0;D_Phase=0; count0=0; } } void Motor_BACK(void) //电机反转函数,即关 { if((count0>0)&&(count0<=3)) { A_Phase=0;B_Phase=0;C_Phase=0;D_Phase=1; } if((count0>3)&&(count0<=6)) { A_Phase=0;B_Phase=0;C_Phase=1;D_Phase=0; } if((count0>6)&&(count0<=9)) { A_Phase=0;B_Phase=1;C_Phase=0;D_Phase=0; } if((count0>9)&&(count0<=12)) { A_Phase=1;B_Phase=0;C_Phase=0;D_Phase=0; } if(count0>12) { A_Phase=0;B_Phase=0;C_Phase=0;D_Phase=0; count0=0; } } /*******************************************************************************************************/ if(GO_flg==1) //关,电机正转 { Motor_GO(); if(Step>=3200) { GO_flg=0; Step=0; OPEN_flg=0; } } if(BACK_flg==1) //开,电机反转 { Motor_BACK(); if(Step>=3200) { BACK_flg=0; Step=0; CLOSE_flg=0; } } } |
|
相关推荐
3个回答
|
|
|
自己给自己顶一波
|
|
|
|
|
|
没有涉及延时程序,电机反应不过来
|
|
|
|
|
|
控制每一个绕组的用中断或延时间隔开
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
265 浏览 0 评论
【原创】【RA4M2-SENSOR开发板评测】低功耗+USB综合测试
789 浏览 0 评论
1306 浏览 2 评论
787 浏览 0 评论
【RA4M2-SENSOR开发板评测】Analogue+Timers综合测试
1587 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
16902 浏览 31 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 09:34 , Processed in 0.822114 second(s), Total 77, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2935