From a2c58dcb519ffcaec2ba24bafc69b91ac916dc8b Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Wed, 31 Jul 2019 08:54:03 -0400 Subject: [PATCH] include an python activity example --- README.md | 13 +++++++------ activity_3.py | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100755 activity_3.py diff --git a/README.md b/README.md index 37a4231..cd4c1e9 100644 --- a/README.md +++ b/README.md @@ -58,12 +58,13 @@ go home ```python #!/usr/bin/env python3 -import armCtl +import armCtl as arm -command(text) +command("go home") -r.target = [90,120,10,95,90,90] -r.move() -while r.isMoving(): -print(r.angle) +arm.r.target = [90, 120, 10, 95, 90, 90] +arm.r.move() +while arm.r.isMoving(): + pass +print(arm.r.angle) ``` diff --git a/activity_3.py b/activity_3.py new file mode 100755 index 0000000..9907996 --- /dev/null +++ b/activity_3.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import armCtl as arm +from time import sleep + +print("waking up the arm") +sleep(5) + +print("going to seq_1") +arm.command("go seq_1") +while arm.r.isMoving(): + pass +print(arm.r.angle) + +print("rotating base +20 degrees") +arm.r.target[0] += 20 +arm.r.move() +while arm.r.isMoving(): + pass +print(arm.r.angle) + +print("going to coordinates") +arm.r.target = [90, 120, 10, 95, 90, 90] +arm.r.move() +while arm.r.isMoving(): + pass +print(arm.r.angle)