From 511635ea709d374f554fd650e82538fb536b67f4 Mon Sep 17 00:00:00 2001
From: Anton Tetov <anton@tetov.se>
Date: Sun, 12 Jun 2022 13:16:49 +0200
Subject: [PATCH] correct pin and states

---
 src/gripper.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gripper.py b/src/gripper.py
index 845315d..aff5b9c 100755
--- a/src/gripper.py
+++ b/src/gripper.py
@@ -6,16 +6,19 @@ from client import FarmbotClient
 from creds import device_id
 from creds import token
 
+GRIPPER_PIN = 12
+GRIPPER_OPEN_STATE = 0
+GRIPPER_CLOSED_STATE = 1
 
 def gripper_open():
     """Manipulate gripper by setting pin to 1."""
     client = FarmbotClient(device_id, token)
-    client.write_pin(1, 1, pin_mode="digital")
+    client.write_pin(GRIPPER_PIN, GRIPPER_OPEN_STATE, pin_mode="digital")
     client.shutdown()
 
 
 def gripper_close():
     """Manipulate gripper by setting pin to 0."""
     client = FarmbotClient(device_id, token)
-    client.write_pin(1, 1, pin_mode="digital")
+    client.write_pin(GRIPPER_PIN, GRIPPER_CLOSED_STATE, pin_mode="digital")
     client.shutdown()
-- 
GitLab