Example #1
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            Debug.Print("Program Started");

            relays = new DigitalOutput[7];
            relays[0] = load.P1;
            relays[1] = load.P2;
            relays[2] = load.P3;
            relays[3] = load.P4;
            relays[4] = load.P5;
            relays[5] = load.P6;
            relays[6] = load.P7;

            var thread = new Thread(CycleRelays);
            thread.Start();
        }
Example #2
0
        private void ProgramStarted()
        {
            /******************************************************************************************
            Access modules defined in the designer by typing their name:

            e.g.  button
                  camera1

            Initialize event handlers here.
            e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);
            ***************************************************************************************** */

            // Do one-time tasks here
            Debug.Print("Program Started");
            button.ButtonPressed += OnButtonPressed;

            _layers = new DigitalOutput[]
                          {
                              extender7.SetupDigitalOutput(Socket.Pin.Six, false),
                              extender7.SetupDigitalOutput(Socket.Pin.Five, false),
                              extender7.SetupDigitalOutput(Socket.Pin.Four, false)
                          };

            _leds = new DigitalOutput[]
                        {
                            extender4.SetupDigitalOutput(Socket.Pin.Eight, false),
                            extender4.SetupDigitalOutput(Socket.Pin.Seven, false),
                            extender4.SetupDigitalOutput(Socket.Pin.Six, false),
                            extender4.SetupDigitalOutput(Socket.Pin.Five, false),
                            extender4.SetupDigitalOutput(Socket.Pin.Four, false),
                            extender4.SetupDigitalOutput(Socket.Pin.Three, false),
                            extender7.SetupDigitalOutput(Socket.Pin.Nine, false),
                            extender7.SetupDigitalOutput(Socket.Pin.Eight, false),
                            extender7.SetupDigitalOutput(Socket.Pin.Seven, false),
                        };
        }