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.ultraArm import ultraArm
import time

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

# ultraArm class initialization requires two parameters: serial port and baud rate
#   The first is the serial port string, such as:
#       linux: "/dev/ttyUSB0"
#       windows: "COM3"
#   The second is the baud rate:115200
#   For example
#           linux:
#              ua = ultraArm("/dev/USB0", 115200)
#           windows:
#              ua = ultraArm("COM3", 115200)
#
# Initialize an ultraArm object
# Create object code for Windows version
ua = ultraArm("COM3", 115200)
ua.go_zero()

time.sleep(2)

ua.set_pwm(128)

results matching ""

    No results matching ""