AForge.Robotics.Lego.RCXBrick.GetBatteryPower C# (CSharp) Method

GetBatteryPower() public method

Get battery power of RCX brick.
public GetBatteryPower ( int &power ) : bool
power int RCX brick's battery power in millivolts.
return bool
        public bool GetBatteryPower( out int power )
        {
            byte[] reply = new byte[3];

            if ( SendCommand( new byte[] { (byte) RCXCommand.GetBatteryPower }, reply, 3 ) )
            {
                power = reply[1] | ( reply[2] << 8 );
                return true;
            }

            power = 0;

            return false;
        }