Pixel matrix functionnality added
This commit is contained in:
parent
361437f1af
commit
93dfdc8485
|
|
@ -1,35 +1,39 @@
|
|||
import matplotlib.pyplot as plt
|
||||
import sys
|
||||
import dobot
|
||||
import time
|
||||
import math
|
||||
|
||||
DRAW_MODE = 1
|
||||
SPEED = 1
|
||||
SIZE = 30
|
||||
INIT_POSITION = [200, -50]
|
||||
DRAW_SPEED = 1
|
||||
DRAW_SIZE = 40
|
||||
DRAW_DEPTH = -69
|
||||
DRAW_RES = 2
|
||||
|
||||
INIT_POSITION = [240, -10]
|
||||
|
||||
dobot.setQueuedCmdClear()
|
||||
dobot.setQueuedCmdStartExec()
|
||||
|
||||
dobot.setPTPJumpParams(10, 50, 1)
|
||||
for x in range(INIT_POSITION[0], INIT_POSITION[0]+SIZE, 1):
|
||||
for y in range(INIT_POSITION[1], INIT_POSITION[1]+SIZE, 1):
|
||||
dobot.setPTPCmd(0, x, y, -68, 1, 1)
|
||||
print(x, y)
|
||||
dobot.setPTPJumpParams(5, 3, 1)
|
||||
|
||||
for i in range(10):
|
||||
dobot.setCPCmd(1, 200, 0, -68, 1, 1)
|
||||
dobot.setCPCmd(1, 200, -50, -68, 1, 1)
|
||||
dobot.setCPCmd(1, 250, -50, -68, 1, 1)
|
||||
dobot.setCPCmd(1, 250, 0, -68, 1, 1)
|
||||
matrix = []
|
||||
for x in range(INIT_POSITION[0], INIT_POSITION[0]+DRAW_SIZE, DRAW_RES):
|
||||
for y in range(INIT_POSITION[1], INIT_POSITION[1]+DRAW_SIZE, DRAW_RES):
|
||||
matrix.append((x,y))
|
||||
|
||||
for point in matrix:
|
||||
dobot.setPTPCmd(1, point[0], point[1], DRAW_DEPTH+5, 0, 1)
|
||||
dobot.setPTPCmd(1, point[0], point[1], DRAW_DEPTH, 0, 1)
|
||||
dobot.setPTPCmd(1, point[0], point[1], DRAW_DEPTH+5, 0, 1)
|
||||
|
||||
dobot.setWaitCmd(3)
|
||||
time.sleep(0.8)
|
||||
|
||||
def pixel_draw(resolution):
|
||||
pass
|
||||
|
||||
def vector_draw(array):
|
||||
for vector in array:
|
||||
dobot.setCPCmd(DRAW_MODE, array.x, array.y, array.z, SPEED, 1)
|
||||
dobot.setCPCmd(DRAW_MODE, array.x, array.y, array.z, DRAW_SPEED, 1)
|
||||
|
||||
# Stop the current execution
|
||||
if input("Appuyez sur Entrer pour arrêter.") == "":
|
||||
|
|
|
|||
Loading…
Reference in New Issue