/// <summary>
            /// Constructs the ButtonPad object and sets the ButtonPad class to
            /// handle the emulated hardware's button interrupts.
            /// </summary>
            /// <param name="sink"></param>
            /// <param name="button"></param>
            /// <param name="pin"></param>
            public ButtonPad(GPIOButtonInputProvider sink, Button button,
                             Cpu.Pin pin)
            {
                this.sink         = sink;
                this.button       = button;
                this.buttonDevice = InputManager.CurrentInputManager.ButtonDevice;

                // When this GPIO pin is true, call the Interrupt method.
                port = new InterruptPort(pin, true, Port.ResistorMode.PullUp,
                                         Port.InterruptMode.InterruptEdgeBoth);
                port.OnInterrupt += new NativeEventHandler(this.Interrupt);
            }
Exemple #2
0
        /// <summary>
        /// The executable entry point.
        /// </summary>
        public static void Main()
        {
            // Create a new program object.
            MyTemperature myApplication = new MyTemperature();

            // Create the main window.
            Window mainWindow = myApplication.CreateWindow();

            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider =
                new GPIOButtonInputProvider(null);

            // Start the application.
            myApplication.Run(mainWindow);
        }
Exemple #3
0
        /// <summary>
        /// The executable entry point.
        /// </summary>
        public static void Main()
        {
            // Create a new program object.
            MyTemperature myApplication = new MyTemperature();

            // Create the main window.
            Window mainWindow = myApplication.CreateWindow();

            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider =
                new GPIOButtonInputProvider(null);

            // Start the application.
            myApplication.Run(mainWindow);
        }
            /// <summary>
            /// Constructs the ButtonPad object and sets the ButtonPad class to 
            /// handle the emulated hardware's button interrupts.
            /// </summary>
            /// <param name="sink"></param>
            /// <param name="button"></param>
            /// <param name="pin"></param>
            public ButtonPad(GPIOButtonInputProvider sink, Button button,
                Cpu.Pin pin)
            {
                this.sink = sink;
                this.button = button;
                this.buttonDevice = InputManager.CurrentInputManager.ButtonDevice;

                // When this GPIO pin is true, call the Interrupt method.
                port = new InterruptPort(pin, true, Port.ResistorMode.PullUp,
                    Port.InterruptMode.InterruptEdgeBoth);
                port.OnInterrupt += new NativeEventHandler(this.Interrupt);
            }