void motor_reset motorY_lunch1; 启动Y轴电机 motorX_lunch1; 启动X轴电机 motorX400001000; 控制X轴电机转动使其旋转40000步速度为100方向为0 motorY400001000; 控制Y轴电机转动使其旋转40000步速度为100方向为0
The above code is written in C++ programming language.
The function "motor_reset" is defined to reset the position of the motors.
The function does the following:
-
Starts the Y-axis motor by calling the "motorY_lunch" function with a parameter value of 1.
-
Starts the X-axis motor by calling the "motorX_lunch" function with a parameter value of 1.
-
Controls the X-axis motor to rotate 40000 steps, with a speed of 100 and a direction of 0, by calling the "motorX" function with these parameter values.
-
Controls the Y-axis motor to rotate 40000 steps, with a speed of 100 and a direction of 0, by calling the "motorY" function with these parameter values.
-
Resets the previous position values of X-axis and Y-axis motors to 0 by setting the values of "X_prenum" and "Y_prenum" to 0.
原文地址: https://www.cveoy.top/t/topic/bsqY 著作权归作者所有。请勿转载和采集!