private static void LcdshieldOnOnButtonPressed(object sender, DfRobotLcdShield.Buttons buttonPressed)
        {
            switch (buttonPressed)
            {
            case DfRobotLcdShield.Buttons.Command1:
                _thunderbolt.ReceiverMode = ReceiverMode.FullPosition;
                // Transmit COM 8 Packet ID: BB  Data Length: 40
                // 00 04 FF 04 02 3E 32 B8 C3 40 80 00 00 41 00 00 00 40 C0 00 00 FF 01 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

                break;

            case DfRobotLcdShield.Buttons.Command2:

                _thunderbolt.ReceiverMode = ReceiverMode.OverDeterminedClock;
                // Transmit COM 8 Packet ID: BB  Data Length: 40
                // 00 07 FF 04 02 3E 32 B8 C3 40 80 00 00 41 00 00 00 40 C0 00 00 FF 01 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

                break;

            case DfRobotLcdShield.Buttons.Command3:
                //_thunderbolt.set_survey_params(1, 1, 5);
                _thunderbolt.start_self_survey();
                break;

            case DfRobotLcdShield.Buttons.Up:
                _pageNumber++;
                if (_pageNumber > 5)
                {
                    _pageNumber = 1;
                }
                _previousPageNumber = _pageNumber;      // Setting this value to override the survey finished change event.
                break;

            case DfRobotLcdShield.Buttons.Down:
                _pageNumber--;
                if (_pageNumber < 1)
                {
                    _pageNumber = 5;
                }
                _previousPageNumber = _pageNumber;      // Setting this value to override the survey finished change event.
                break;
            }
        }
Exemple #2
0
        private static void LcdShieldOnOnButtonPressed(object sender, DfRobotLcdShield.Buttons buttonPressed)
        {
            switch (buttonPressed)
            {
            case DfRobotLcdShield.Buttons.Command1:
                _thunderbolt.ReceiverMode = ReceiverMode.FullPosition;
                break;

            case DfRobotLcdShield.Buttons.Command2:
                _thunderbolt.ReceiverMode = ReceiverMode.OverDeterminedClock;
                break;

            case DfRobotLcdShield.Buttons.Command3:
                _thunderbolt.set_survey_params(1, 1, 200);
                _thunderbolt.start_self_survey();
                break;

            case DfRobotLcdShield.Buttons.Up:
                _pageNumber++;
                if (_pageNumber > _numberOfPages)
                {
                    _pageNumber = 1;
                }
                _previousPageNumber = _pageNumber;      // Setting this value to override the survey finished change event.
                break;

            case DfRobotLcdShield.Buttons.Down:
                _pageNumber--;
                if (_pageNumber < 1)
                {
                    _pageNumber = _numberOfPages;
                }
                _previousPageNumber = _pageNumber;      // Setting this value to override the survey finished change event.
                break;
            }
        }