|
| 1 | +import time, subprocess |
| 2 | +from pymycobot.mycobot import MyCobot |
| 3 | + |
| 4 | + |
| 5 | +if __name__ == '__main__': |
| 6 | + # port = subprocess.check_output(['echo -n /dev/ttyUSB*'], |
| 7 | + # shell=True).decode() |
| 8 | + # port = "/dev/cu.usbserial-0203B030" |
| 9 | + port = "/dev/cu.usbserial-0213245D" |
| 10 | + cobot = MyCobot(port) |
| 11 | + # test(cobot) |
| 12 | + cobot.send_angles([0,0,0,0,0,0],100) |
| 13 | + time.sleep(10) |
| 14 | + print('over') |
| 15 | + for count in range(50): |
| 16 | + time.sleep(0.05) |
| 17 | + cobot.send_angle(1, (-30), 100) |
| 18 | + time.sleep(0.05) |
| 19 | + cobot.send_angle(2, 70, 100) |
| 20 | + time.sleep(0.05) |
| 21 | + cobot.send_angle(3, (-110), 100) |
| 22 | + time.sleep(0.05) |
| 23 | + cobot.send_angle(4, (-100), 100) |
| 24 | + time.sleep(0.05) |
| 25 | + cobot.send_angle(5, 0, 100) |
| 26 | + time.sleep(0.05) |
| 27 | + cobot.send_angle(6, 0, 100) |
| 28 | + time.sleep(1) |
| 29 | + cobot.send_angle(2, 0, 100) |
| 30 | + time.sleep(0.05) |
| 31 | + cobot.send_angle(6, 0, 100) |
| 32 | + time.sleep(0.05) |
| 33 | + cobot.send_angle(5, 0, 100) |
| 34 | + time.sleep(0.05) |
| 35 | + cobot.send_angle(4, 0, 100) |
| 36 | + time.sleep(0.05) |
| 37 | + cobot.send_angle(3, 0, 100) |
| 38 | + time.sleep(0.05) |
| 39 | + cobot.send_angle(1, 0, 100) |
| 40 | + time.sleep(1) |
| 41 | + cobot.send_angle(1, 60, 100) |
| 42 | + time.sleep(0.05) |
| 43 | + cobot.send_angle(2, 70, 100) |
| 44 | + time.sleep(0.05) |
| 45 | + cobot.send_angle(3, (-100), 100) |
| 46 | + time.sleep(0.05) |
| 47 | + cobot.send_angle(4, (-100), 100) |
| 48 | + time.sleep(0.05) |
| 49 | + cobot.send_angle(5, 0, 100) |
| 50 | + time.sleep(0.05) |
| 51 | + cobot.send_angle(6, 0, 100) |
| 52 | + time.sleep(1) |
| 53 | + cobot.send_angle(2, 0, 100) |
| 54 | + time.sleep(0.05) |
| 55 | + cobot.send_angle(6, 0, 100) |
| 56 | + time.sleep(0.05) |
| 57 | + cobot.send_angle(5, 0, 100) |
| 58 | + time.sleep(0.05) |
| 59 | + cobot.send_angle(4, 0, 100) |
| 60 | + time.sleep(0.05) |
| 61 | + cobot.send_angle(3, 0, 100) |
| 62 | + time.sleep(0.05) |
| 63 | + cobot.send_angle(1, 0, 100) |
| 64 | + time.sleep(1) |
| 65 | + print('time') |
0 commit comments