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

replace gripper functions with ones using farmbot_os

parent f104b5fb
Branches
Tags
No related merge requests found
#!/usr/bin/env python3
import serial
"""Functions to manipulate gripper.
TODO: Integrate with FarmbotClient or FarmbotYoloClient
"""
from client import FarmbotClient
from creds import device_id
from creds import token
def gripper_open():
ser = serial.Serial('/dev/ttyUSB0')
ser.write(str.encode("o"))
ser.close
"""Manipulate gripper by setting pin to 1."""
client = FarmbotClient(device_id, token)
client.write_pin(1, 1, pin_mode="digital")
client.shutdown()
def gripper_close():
ser = serial.Serial('/dev/ttyUSB0')
ser.write(str.encode("c"))
ser.close
\ No newline at end of file
"""Manipulate gripper by setting pin to 0."""
client = FarmbotClient(device_id, token)
client.write_pin(1, 1, pin_mode="digital")
client.shutdown()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment