C++ Motor Reset Function: motor_reset() Explanation
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/mVMM 著作权归作者所有。请勿转载和采集!