4、Test the robot arm

Introduction of API


Function:Determine if six joint points are working properly.

Return parameter:1 indicates working properly,0 means that it doesn't work,-1 indicates an error alarm.


Function:Let a joint point move continuously.

Parameter Description:

joint_id:value range1-6, six integers represent joint points 1 to 6.

direction:1 indicates increase in angle,0 indicates decrease in angle.

speed:Indicates the speed of increase and decrease.


Function:Stop the movement of joint points.


Function:Relax the specified joint points.

Parameter Description:

servo_id:valuer range 1-6, six integers represent joint points 1 to 6.


Function:Secure the specified joint points

Parameter Description

servo_id:valuer range 1-6, six integers represent joint points 1 to 6.

Content of code

from pymycobot.mycobot import MyCobot
from pymycobot import PI_PORT, PI_BAUD  # When using the Raspberry Pi version of myCobot, you can refer to these two variables for MyCobot initialization
import time

# Initialize a MyCobot object
mc = MyCobot(PI_PORT, PI_BAUD)
# Determine whether the robot arm is powered or not, and if there is no power supply, it needs to be powered first
if not mc.is_power_on():
    # Power the robot arm

# Check that the six joints are working properly
# You can also use is_servo_enable(servo_id) to change single calibration
if mc.is_all_servo_enable():
    # Power off the robot arm
    # Check whether the robot arm is power off
    if mc.is_all_servo_enable() == -1:

Effects as shown


results matching ""

    No results matching ""