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


public class ServoM3 : MonoBehaviour
{
    public int servoPin = 11;
    [Range(0, 180)]
    public int servoAngle = 90;
    private int prevServoAngle = 90;
    public ArmControl file;

    void Start()
    {



    }

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

