public async Task PenUp() { if (isPenUp) { return; } servo.SetAngle(120); await Task.Delay(300); isPenUp = true; //logger.WriteLn("Pen up", LogType.Info); }
public void TestServeSetOutsideAngleUnder() { using (Servo s = NewServo()) { s.SetAngle(-10.5); Assert.AreEqual(s.GetAngle(), 0.0, .1); } }
public void TestServoSetAngle() { using (Servo s = NewServo()) { s.SetAngle(76.5); Assert.AreEqual(s.GetAngle(), 76.5); } }
public void TestServeSetOutsideAngleOver() { using (Servo s = NewServo()) { s.SetAngle(185.9); Assert.AreEqual(s.GetAngle(), 180.0, .1); } }
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)); } }