Пример #1
0
 public Motor(MotorShield shield, OutputPort port, byte bitmaskUp, byte bitmaskDown)
 {
   _shield = shield;
   _bitmaskUp = bitmaskUp;
   _bitmaskDown = bitmaskDown;
   _port = port;
 }
Пример #2
0
 public static void TestSensors()
 {
   var hw = IO.Instance;
   var ms = new MotorShield();
   ms.Start();
   TestSensors(ms.MotorCoop, hw.DoorSensorCoopOpened, hw.DoorSensorCoopClosed);
   TestSensors(ms.MotorYard, hw.DoorSensorYardOpened, hw.DoorSensorYardClosed);
 }
Пример #3
0
    public Machinery()
    {
      Sequencer = new CommandSequencer();

      var hw = IO.Instance;
      BoardLED = hw.BoardLED;

      // Setup doors with motors
      _motorShield = new MotorShield();
      DoorCoop = new Door("Coop", _motorShield.MotorCoop, hw.DoorSensorCoopOpened, hw.DoorSensorCoopClosed);
      DoorYard = new OfflineDoor("Yard", _motorShield.MotorYard, hw.DoorSensorYardOpened, hw.DoorSensorYardClosed);

      // Setup the user input button
      PushButton = new PushButton();

      // Setup the relays
      Power1 = new Relay("Power1", hw.Relay1);
      Power2 = new Relay("Power2", hw.Relay2);
    }