找回密码
 立即注册
楼主: 梁工

51开源,步进电机驱动 程序, 直接驱动, 或驱动步进电机驱动器 一共8个程序

 火.. [复制链接]
  • 打卡等级:以坛为家II
  • 打卡总天数:410
  • 最近打卡:2026-07-21 09:39:09

83

主题

7972

回帖

1万

积分

超级版主

积分
17025
发表于 5 天前 | 显示全部楼层
Hell0*** 发表于 2026-7-17 08:45
程序可以移植到89c52上面吗

89C52只能使用定时器。
回复

使用道具 举报 送花

  • 打卡等级:以坛为家III
  • 打卡总天数:875
  • 最近打卡:2026-07-22 08:12:31

10

主题

121

回帖

3393

积分

论坛元老

积分
3393
发表于 3 天前 | 显示全部楼层
Hell0*** 发表于 2026-7-17 10:02
你也做过这个吗,可以发例程吗谢谢

可以的,互相学习
回复

使用道具 举报 送花

  • 打卡等级:以坛为家III
  • 打卡总天数:875
  • 最近打卡:2026-07-22 08:12:31

10

主题

121

回帖

3393

积分

论坛元老

积分
3393
发表于 3 天前 | 显示全部楼层
Wd*** 发表于 2026-7-19 00:33
可以的,互相学习

我这写的比较LOW,见笑了,
// 电机转动一步函数
void Step_Motor(Motor_Pins *motor_pins, unsigned int delay_time) {
    static unsigned char num = 0;
    switch (num) {
    case 0:
        motor_pins->A = 1;
        motor_pins->B = 0;
        motor_pins->C = 0;
        motor_pins->D = 0;
        break;
    case 1:
        motor_pins->A = 1;
        motor_pins->B = 1;
        motor_pins->C = 0;
        motor_pins->D = 0;
        break;
    case 2:
        motor_pins->A = 0;
        motor_pins->B = 1;
        motor_pins->C = 0;
        motor_pins->D = 0;
        break;
    case 3:
        motor_pins->A = 0;
        motor_pins->B = 1;
        motor_pins->C = 1;
        motor_pins->D = 0;
        break;
    case 4:
        motor_pins->A = 0;
        motor_pins->B = 0;
        motor_pins->C = 1;
        motor_pins->D = 0;
        break;
    case 5:
        motor_pins->A = 0;
        motor_pins->B = 0;
        motor_pins->C = 1;
        motor_pins->D = 1;
        break;
    case 6:
        motor_pins->A = 0;
        motor_pins->B = 0;
        motor_pins->C = 0;
        motor_pins->D = 1;
        break;
    case 7:
        motor_pins->A = 1;
        motor_pins->B = 0;
        motor_pins->C = 0;
        motor_pins->D = 1;
        break;
    }
    num++;
    if (num == 8) {
        num = 0;
    }
    Delay_ms(delay_time);
}
回复

使用道具 举报 送花

  • 打卡等级:偶尔看看I
  • 打卡总天数:15
  • 最近打卡:2026-07-21 08:59:58
已绑定手机

1

主题

30

回帖

37

积分

新手上路

积分
37
发表于 3 天前 | 显示全部楼层
Wd*** 发表于 2026-7-19 00:33
可以的,互相学习

谢谢我试试
回复

使用道具 举报 送花

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )

GMT+8, 2026-7-22 09:25 , Processed in 0.076949 second(s), 63 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表