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


public class ServoM5 : MonoBehaviour
{
    public int servoPin = 3;
    
    public int servoAngle = 50;
    private int prevServoAngle = 50;
    public ArmControl file;

    void Start()
    {



    }

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