Gripper control

The main function of this JavaScript code is to initialize a robot arm connection through the mycobot library and set the switch state and angle value of the robot arm gripper. Specifically, the code implements the following operations:

Connect the robot arm: connect to the robot arm by specifying the serial port (COM15) and baud rate (115200).

Set the switch state of the robot arm gripper: control the opening and closing of the gripper by specifying the switch state (0 for open, 1 for closed) and the operating speed (ranging from 0 to 100).

Set the angle value of the robot arm gripper: control the angle and movement speed of the gripper by specifying the angle value and speed (both ranging from 0 to 100).

<!-- Initialization program -->
const mycobot = require('mycobot')

const obj = mycobot.connect('COM15',115200)

<!-- Set the switch state of the gripper mycobot.setGripperState(switch state, operation speed)-->
<!-- Note: switch state reference value: 0 is open, 1 is closed, and the operation speed limit is 0~100 -->
obj.write(mycobot.setGripperState(0,10))

<!-- Set the angle value of the gripper mycobot.setGripperValue(angle value, speed)-->
<!-- Note: the angle value and speed value limit are 0~100 -->
obj.write(mycobot.setGripperValue(80,20)))

results matching ""

    No results matching ""