Esempio n. 1
0
        public async Task PenUp()
        {
            if (isPenUp)
            {
                return;
            }
            servo.SetAngle(120);
            await Task.Delay(300);

            isPenUp = true;
            //logger.WriteLn("Pen up", LogType.Info);
        }
Esempio n. 2
0
 public void TestServeSetOutsideAngleUnder()
 {
     using (Servo s = NewServo())
     {
         s.SetAngle(-10.5);
         Assert.AreEqual(s.GetAngle(), 0.0, .1);
     }
 }
Esempio n. 3
0
 public void TestServoSetAngle()
 {
     using (Servo s = NewServo())
     {
         s.SetAngle(76.5);
         Assert.AreEqual(s.GetAngle(), 76.5);
     }
 }
Esempio n. 4
0
 public void TestServeSetOutsideAngleOver()
 {
     using (Servo s = NewServo())
     {
         s.SetAngle(185.9);
         Assert.AreEqual(s.GetAngle(), 180.0, .1);
     }
 }
Esempio n. 5
0
 public void TestValueChanged()
 {
     using (Servo s = NewServo())
     {
         s.SetAngle(80.0);
         Assert.That(s.GetAngle, Is.EqualTo(80.0).Within(0.1));
         s.ValueChanged(null, null, Value.MakeDouble(.56), NetworkTables.NotifyFlags.NotifyLocal);
         Assert.That(s.Get, Is.EqualTo(.56).Within(0.01));
         s.ValueChanged(null, null, Value.MakeDouble(-.58), NetworkTables.NotifyFlags.NotifyLocal);
         Assert.That(s.Get, Is.EqualTo(0.0).Within(0.01));
     }
 }