def myarm(a, b): x = 14 * a + 136 y = 140 - 14 * b # Connect to uArm myRobot = uArmRobot.robot(serialport) # myRobot.__init__(serialport) myRobot.debug = True # Enable / Disable debug output on screen, by default disabled myRobot.connect() myRobot.mode(0) # Set mode to Normal time.sleep(1) # Move robot, command will complete when motion is completed myRobot.goto(150, 0, 100, 30000) myRobot.goto(120, 0, 100, 30000) myRobot.pump(True) time.sleep(5) # 一格14mm # 落下33mm myRobot.goto(x, y, 35, 30000) time.sleep(2) myRobot.pump(False) time.sleep(3) # myRobot.async_goto(112,0,32,6000) myRobot.goto(150, 0, 100, 30000) time.sleep(5) # Disconnect serial connection myRobot.disconnect()
# uArm Swift Pro - Python Library Example # Created by: Richard Garsthagen - [email protected] # V0.1 - June 2017 - Still under development import uArmRobot import time bots = 2 #Configure Serial Port myRobot = [] myRobot.append(uArmRobot.robot("com3")) myRobot.append(uArmRobot.robot("com4")) # Enable / Disable debug output on screen, by default disabled #uArmRobot.robot.debug = True # Connect to all the robots for b in range(0,bots): myRobot[b].connect() myRobot[b].mode(0) time.sleep(1) # Move robot one by one print ("Move 1") for b in range(0,bots): myRobot[b].goto(200,0,100,6000)
# Script for drawing a grid with the laser for calibration purposes # Requires the python library from https://github.com/AnykeyNL/uArmProPython with the goto_laser-modification described in 'issue #1' # Please, don't leave the arm unattended will operating the laser. import uArmRobot mode = 1 #Configure Serial port #serialport = "com3" # for windows serialport = "/dev/ttyACM0" # for linux like system # Connect to uArm myRobot = uArmRobot.robot(serialport) myRobot.debug = True # Enable / Disable debug output on screen, by default disabled myRobot.connect() myRobot.mode(mode) # Set mode to Normal # Larger grid #gridSizeX = 120 #gridSizeY = 200 #gridOffsetX = 140 # Smaller test grid gridSizeX = 40 gridSizeY = 40 gridOffsetX = 180 workingHeight = 150 drawSpeed = 1000
import easycv2 import uArmRobot import time r = easycv2.Calibrate(25) serialport = "com10" myRobot = uArmRobot.robot( serialport, 1) # user 0 for firmware < v4 and use 1 for firmware v4 myRobot.debug = True # Enable / Disable debug output on screen, by default disabled myRobot.connect() myRobot.mode(0) # Set mode to Normal time.sleep(1) myRobot.goto(300, -100, 10, 20) time.sleep(2) myRobot.disconnect()
# uArm Swift Pro - Python Library Example # Created by: Richard Garsthagen - [email protected] # V0.3 - June 2018 - Still under development # # Use Python 2.x! import uArmRobot import time bots = 2 #Configure Serial Port myRobot = [] myRobot.append(uArmRobot.robot( "com3", 0)) # user 0 for firmware < v4 and use 1 for firmware v4 myRobot.append(uArmRobot.robot( "com4", 0)) # user 0 for firmware < v4 and use 1 for firmware v4 # Enable / Disable debug output on screen, by default disabled #uArmRobot.robot.debug = True # Connect to all the robots for b in range(0, bots): myRobot[b].connect() myRobot[b].mode(0) time.sleep(1) # Move robot one by one print("Move 1") for b in range(0, bots):