Laser engraving

1 Functional interface

2.13 set_pwm()

  • Function: Set PWM duty cycle
  • Parameter description: P:Duty cycle, range: 0-255
  • Return value: None

2 Getting Started

from pymycobot.ultraArmP340 import ultraArmP340
import time

#The above should be written at the beginning of the code, meaning to import the project package

<<<<<<< HEAD
# ultraArmP340 class initialization requires two parameters: serial port and baud rate
#   The first is the serial port string, such as:
=======
# ultraArmP340 类初始化需要两个参数:串口和波特率
#   第一个是串口字符串, 如:
>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
#       linux: "/dev/ttyUSB0"
#       windows: "COM3"
#   The second is the baud rate:115200
#   For example
#           linux:
#              ua = ultraArmP340("/dev/USB0", 115200)
#           windows:
#              ua = ultraArmP340("COM3", 115200)
#
<<<<<<< HEAD
# Initialize an ultraArmP340 object
# Create object code for Windows version
=======
# 初始化一个ultraArmP340对象
# 下面为 windows版本创建对象代码
>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
ua = ultraArmP340("COM3", 115200)
ua.go_zero()

time.sleep(2)

ua.set_pwm(128)

results matching ""

    No results matching ""