Exemplo n.º 1
0
        private void statusTimer_Tick(object sender, EventArgs e)
        {
            txbCountdown.Text = _Countdown.ToString();

            if (_Countdown == 0)
            {
                resultTimer.Start();
                statusTimer.Stop();
                txbCountdown.Text = "";
                ResetVariables();
                _device = HIDDevice.GetHIDDevice(0x57E, 0x306);
                _start  = true;

                if (_device != null)
                {
                    Report(0x11, new byte[1] {
                        _ledRumble
                    });
                    EnableConfigureIR();
                    Report(0x12, new byte[2] {
                        0x04, 0x37
                    });
                    RndNumber();
                }
                else
                {
                    Console.WriteLine("Geen device gevonden");
                }
            }
            else
            {
                _Countdown--;
            }
        }
        public int[] _zPlusCal = { 508, 504, 616, 518 }; //Plat op tafel


        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Connectie openen met HID device met als vendor ID &H57E en als product ID &H306
            _device = HIDDevice.GetHIDDevice(0x57E, 0x306);

            if (_device != null)
            {
                EnableConfigureIR();
                FirstLed();
                Report(0x12, new byte[2] {
                    0x04, 0x37
                });

                //StatusTimer set
                statusTimer.Tick    += new EventHandler(statusTimer_Tick);
                statusTimer.Interval = new TimeSpan(0, 0, 0, 1);
                statusTimer.Start();
            }
            else
            {
                Console.WriteLine("Geen device gevonden");
            }
        }