コード例 #1
0
ファイル: MyLegoCarService.cs プロジェクト: gokulm/LEGO.Bot
        private void DriveEncoderHandler(drive.DriveEncodersUpdate statistics)
        {
            LeftEncoderCurrent = statistics.Body.LeftEncoderCurrent;
            RightEncoderCurrent = statistics.Body.RightEncoderCurrent;
            LeftPowerCurrent = statistics.Body.LeftPowerCurrent;
            RightPowerCurrent = statistics.Body.RightPowerCurrent;

        }
コード例 #2
0
ファイル: Lab4_201_09.cs プロジェクト: clpun/waterloo-labs
        private void driveSensorHandler(drive.DriveEncodersUpdate notification)
        {
            //notification.Body.RightPowerTarget vs notification.Body.RightPowerCurrent difference?

            // This sets the value of motorSpinning to true if the power of any of the motors is not 0 else it sets the
            // value to false
            if (notification.Body.RightPowerCurrent != 0 && notification.Body.LeftPowerCurrent != 0)
            {
                motorSpinning = true;
            }
            else
            {
                motorSpinning = false;
            }

            // Get current encoder readings (may use in future)
            rightEncoder = notification.Body.RightEncoderCurrent;
            leftEncoder  = notification.Body.LeftEncoderCurrent;
        }