Skip to content
Snippets Groups Projects
Commit 511635ea authored by Anton Tetov Johansson's avatar Anton Tetov Johansson
Browse files

correct pin and states

parent 6716c9ff
No related branches found
No related tags found
No related merge requests found
...@@ -6,16 +6,19 @@ from client import FarmbotClient ...@@ -6,16 +6,19 @@ from client import FarmbotClient
from creds import device_id from creds import device_id
from creds import token from creds import token
GRIPPER_PIN = 12
GRIPPER_OPEN_STATE = 0
GRIPPER_CLOSED_STATE = 1
def gripper_open(): def gripper_open():
"""Manipulate gripper by setting pin to 1.""" """Manipulate gripper by setting pin to 1."""
client = FarmbotClient(device_id, token) 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() client.shutdown()
def gripper_close(): def gripper_close():
"""Manipulate gripper by setting pin to 0.""" """Manipulate gripper by setting pin to 0."""
client = FarmbotClient(device_id, token) 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() client.shutdown()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment