nxtlib/src/Protocol.cs
/// <summary> 
/// [Native] Returns the voltage of the NXT battery, in millivolts.
/// </summary>
/// <returns>The battery level, in millivolts.</returns>
[Native] Returns the voltage of the NXT battery, in millivolts.
[ Native ] Returns the voltage of the NXT battery in millivolts .
public int GetBatteryLevel()
        {
            byte[] request = new byte[] {
            0x00,
            (byte) DirectCommand.GetBatteryLevel
            };
            byte[] reply = CompleteRequest(request);
            UInt16 voltage = GetUInt16(reply, 3);
            return Convert.ToInt32(voltage);
        }
public int GetBatteryLevel ( ) { byte [ ] request = new byte [ ] { 0x00 , ( byte ) DirectCommand . GetBatteryLevel } ; byte [ ] reply = CompleteRequest ( request ) ; UInt16 voltage = GetUInt16 ( reply , 3 ) ; return Convert . ToInt32 ( voltage ) ; }
[Native] Returns the voltage of the NXT battery, in millivolts.
[ Native ] Returns the voltage of the NXT battery in millivolts .
The battery level, in millivolts.
The battery level in millivolts .