using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Uduino;


public class Gripper : MonoBehaviour
{
    public int servoPin = 3;
    [Range(10,110)]
    public int servoAngle = 50;
    private int prevServoAngle = 50;
    

    void Start()
    {



    }

    void Update()
    {
        
        if (servoAngle != prevServoAngle) // Condition to not send data each frame 
        {
            UduinoManager.Instance.sendCommand("movegripper", servoAngle);
            prevServoAngle = servoAngle;
        }
    }
}