From 7ea779acc8310e3feb7076f89591d6f1abd71e18 Mon Sep 17 00:00:00 2001 From: pengqi Date: Mon, 2 Mar 2026 11:15:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E9=98=B2=E6=AD=A2=E7=A8=8B=E5=BA=8F=E9=80=80?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM/DM_Motor_controller.py | 3 +++ RK1106/stepper_motor.py | 9 +++++++++ conveyor_controller/conveyor_motor.py | 4 ++++ servo/servo_control.py | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/DM/DM_Motor_controller.py b/DM/DM_Motor_controller.py index 8662570..0d86109 100644 --- a/DM/DM_Motor_controller.py +++ b/DM/DM_Motor_controller.py @@ -254,3 +254,6 @@ if __name__ == '__main__': move_to_ori_position() time.sleep(5) # 电机运动需要的时间 + while(True): + time.sleep(1) + diff --git a/RK1106/stepper_motor.py b/RK1106/stepper_motor.py index 6c040f8..cfc1025 100644 --- a/RK1106/stepper_motor.py +++ b/RK1106/stepper_motor.py @@ -213,4 +213,13 @@ def cleanup(): if __name__ == '__main__': align_wire(speed=2500, cycle=10.0) time.sleep(10) # 电机运动需要的时间 + + # 测试是否电机能停止 + motor_start(speed=2500, cycle=5.0, direction=0) + time.sleep(1) # 电机运动需要的时间 + motor_stop() + time.sleep(0.2) + + while(True): # 防止程序退出 + time.sleep(1) diff --git a/conveyor_controller/conveyor_motor.py b/conveyor_controller/conveyor_motor.py index 9e522bb..b0517c5 100644 --- a/conveyor_controller/conveyor_motor.py +++ b/conveyor_controller/conveyor_motor.py @@ -390,3 +390,7 @@ if __name__ == '__main__': time.sleep(1) sync_motor_move(False) + time.sleep(0.5) + + while(True): + time.sleep(1) diff --git a/servo/servo_control.py b/servo/servo_control.py index 356a2c3..42e114c 100644 --- a/servo/servo_control.py +++ b/servo/servo_control.py @@ -145,3 +145,7 @@ if __name__ == '__main__': time.sleep(1) move_to_ori_position() # 旋转0度 time.sleep(1) + + while(True): + time.sleep(1) +