<!-- initialize the program -->
const mycobot = require('mycobot')
const obj = mycobot.connect('COM15',115200)
<!-- set the angle of single robot arm mycobot.sendAngle(robot arm ID, angle value, the running speed at which the robot arm adjusts the angle)-->
<!-- Note:When setting the value to change the angle, pay attention to the number of robot arm joints. if the number is 4, input 1-4; if the number is 6, input 1-6; otherwise an error is reported.-->
<!-- For setting of the angles of four-axis and six-axis robot arms, see Digram 1-3 -->
obj.write(mycobot.sendAngle(1,110,10))
<!-- set the coordinate of a single robot arm mycobot.sendCoord(robot armID, coordinate value, the the movement speed at which the robot arm adjusts the coordinate)-->
obj.write(mycobot.sendCoord(1,20,10))
2 Multi-joint control
Note: When operating multiple joints, fill in the parameters corresponding to the number of joints of the robot arm.
<!-- initialize the program -->
const mycobot = require('mycobot')
const obj = mycobot.connect('COM15',115200)
<!-- set the angle of the multi-joint robot arm mycobot.sendAngles([angle of joint 1, angle of joint 2, angle of joint 3, angle of joint 4, angle of joint 5, angle of joint 6], joint running speed) -->
<!-- set the coordinate of the multi-joint robot arm mycobot.sendCoords([coordinate of joint 1, coordinate of joint 2, coordinate of joint 3, coordinate of joint 4, coordinate of joint 5, coordinate of joint 6], joint running speed) -->
obj.write(mycobot.sendCoords([22.5,12,-22,45],20))
3 Standard parameters of angles and coordinates of four-axis and six-axis robot arms