public MotorShield()
 {
   _coop = new Motor(this, IO.Instance.MotorShieldCoop, 0x08, 0x04);
   _yard = new Motor(this, IO.Instance.MotorShieldYard, 0x10, 0x02);
   //// M3 = new Motor(this, ..., 0x80, 0x20);
   //// M4 = new Motor(this, ..., 0x40, 0x01);
 }
Exemple #2
0
 public Door(string name, Motor motor, InputPort doorOpen, InputPort doorClosed)
 {
   Name = name;
   _motor = motor;
   _doorOpen = doorOpen;
   _doorClosed = doorClosed;
   Status = DoorStatus.Unknown;
 }
 private static void TestSensors(Motor motor, InputPort open, InputPort closed)
 {
   int sleep = 500;
   bool enabled = false;
   while (true)
   {
     IO.Instance.MotorShieldEnable.Write(enabled); enabled = !enabled;
     IO.Instance.BoardLED.Write(true);
     motor.Down();
     Thread.Sleep(sleep);
   //  Debug.Print("Coop: open=" + open.Read() + " closed=" + closed.Read());
     motor.Off();
     Thread.Sleep(sleep);
     IO.Instance.BoardLED.Write(false);
     motor.Up();
     Thread.Sleep(sleep);
   //  Debug.Print("Coop: open=" + open.Read() + " closed=" + closed.Read());
     motor.Off();
     Thread.Sleep(sleep);
   }
 }
 public OfflineDoor(string name, Motor motor, InputPort doorOpen, InputPort doorClosed)
 {
   Name = name;
 }