private async void MainPage_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            _dispatcher   = CoreWindow.GetForCurrentThread().Dispatcher;
            _blinkyLed    = new BlinkyDriver(blinkyPin);
            _speechDriver = new SpeechDriver();
            await _speechDriver.InitializeAsync();

            _speechDriver.Activated += SpeechDriver_Activated;
            _speechDriver.SpeechCommandTriggered += SpeechCommandTriggered;

            _driver = new TwoMotorsDriver(
                new Motor(leftMotorPin1, leftMotorPin2),
                new Motor(rightMotorPin1, rightMotorPin2));
            await _speechDriver.StartAsync();

            _worker         = new BackgroundWorker();
            _worker.DoWork += DoWork;
            _worker.RunWorkerAsync();
        }
        private async void MainPage_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            _dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            _blinkyLed = new BlinkyDriver(blinkyPin);
            _speechDriver = new SpeechDriver();
            await _speechDriver.InitializeAsync();
            _speechDriver.Activated += SpeechDriver_Activated;
            _speechDriver.SpeechCommandTriggered += SpeechCommandTriggered;

            _driver = new TwoMotorsDriver(
                    new Motor(leftMotorPin1, leftMotorPin2),
                    new Motor(rightMotorPin1, rightMotorPin2));
            await _speechDriver.StartAsync();

            _worker = new BackgroundWorker();
            _worker.DoWork += DoWork;
            _worker.RunWorkerAsync();
        }
        private void SpeechCommandTriggered(object sender, SpeechDriver.SpeechIntentArgs e)
        {
            lock(_stateLock)
            {
                switch (e.Intent)
                {
                    case "RightTurn":
                        _roverState.TurnState = RoverTurnState.Right;
                        break;

                    case "LeftTurn":
                        _roverState.TurnState = RoverTurnState.Left;
                        break;

                    case "Play":
                        _roverState.TurnState = RoverTurnState.Play;
                        break;

                    case "Attack":
                        _roverState.TurnState = RoverTurnState.Attack;
                        break;

                    case "TurnAround":
                        _roverState.TurnState = RoverTurnState.TurnAround;
                        break;

                    case "Run":
                    case "Forward":
                        _roverState.MoveState = RoverMoveState.Forward;
                        break;

                    case "Backward":
                        _roverState.MoveState = RoverMoveState.Backward;
                        break;

                    case "Stop":
                        _roverState.MoveState = RoverMoveState.Stopped;
                        break;
                    

                }
            }

            WriteLog($"Voice command received: {e.Intent}");
        }