Ejemplo n.º 1
0
        public DrivePage()
        {
            InitializeComponent();

            if (App.CurrentConnection != null)
            {
                MessageBox.Show(string.Format("Connected to {0}", App.CurrentConnection.BluetoothName));
                _spheroDevice = new SpheroDevice(App.CurrentConnection);
                _spheroDevice.SetBackLED(1.0f);
                spheroJoystick.Start();
            }
            else
                NavigationService.GoBack();
        }
Ejemplo n.º 2
0
        public GamePlayPage()
        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += navigationHelper_LoadState;
            this.navigationHelper.SaveState += navigationHelper_SaveState;

            //Initizlizes Bluetooth connection
            if (App.CurrentConnection != null)
            {
                _spheroDevice = new SpheroDevice(App.CurrentConnection);
                _spheroDevice.SetBackLED(1.0f);
                spheroJoystick.Start();
            }

        }
Ejemplo n.º 3
0
        public CalibrationPage()
        {
            InitializeComponent();

            if (App.CurrentConnection != null)
            {
                _spheroDevice = new SpheroDevice(App.CurrentConnection);

                // OFF Stabilization et set LEDs
                _spheroDevice.StabilizationOFF();
                _spheroDevice.SetRGBLED(0.5f, 0, 0);
                _spheroDevice.SetBackLED(1.0f);
            }
            else
                NavigationService.GoBack();
        }
Ejemplo n.º 4
0
        public DrivePage()
        {
            InitializeComponent();

            if (App.CurrentConnection != null)
            {
                MessageBox.Show(string.Format("Connected to {0}", App.CurrentConnection.BluetoothName));
                _spheroDevice = new SpheroDevice(App.CurrentConnection);
                _spheroDevice.SetBackLED(1.0f);

                // Configure collision detection and subscribe to detection event
                _spheroDevice.ConfigureCollisionDetection(CollisionMethod.Enable, 125, 125, 125, 125, 50);
                _spheroDevice.CollisionDetected += _spheroDevice_CollisionDetected;

                spheroJoystick.Start();
            }
            else
                NavigationService.GoBack();
        }