Esempio n. 1
0
    void Start()
    {
        string address       = "/servo";
        int    servoPosition = 0;

        servoClient.SendServoPosition(address, servoPosition);
    }
Esempio n. 2
0
 void Start()
 {
     Observable.Interval(TimeSpan.FromMilliseconds(20)).Subscribe(_ =>
     {
         string address   = "/servo";
         float stickAngle = hingeJoint.angle;
         int servoAngle   = 0;
         if (stickAngle > 0 && stickAngle <= 23)
         {
             servoAngle = (int)stickAngle;
         }
         else if (stickAngle >= 23)
         {
             servoAngle = 23;
         }
         servoClient.SendServoPosition(address, servoAngle);
     }).AddTo(this);
 }