nxtlib/src/Protocol.cs
/// <summary> 
/// [Native] Plays a beep tone on the NXT brick.
/// </summary>
/// <param name="frequency">The frequency, in Hz, where frequency is between 200 and 14000 Hz.</param>
/// <param name="duration">The duration of the tone, in milliseconds.</param>
[Native] Plays a beep tone on the NXT brick.
[ Native ] Plays a beep tone on the NXT brick .
public void PlayTone(UInt16 frequency, UInt16 duration)
        {
            if (frequency < 200) frequency = 200;
            if (frequency > 14000) frequency = 14000;
            byte[] request = new byte[6];
            request[0] = (byte)(0x00);
            request[1] = (byte)(DirectCommand.PlayTone);
            SetUInt16(frequency, request, 2);
            SetUInt16(duration, request, 4);
            CompleteRequest(request);
            return;
        }
public void PlayTone ( UInt16 frequency , UInt16 duration ) { if ( frequency < 200 ) frequency = 200 ; if ( frequency > 14000 ) frequency = 14000 ; byte [ ] request = new byte [ 6 ] ; request [ 0 ] = ( byte ) ( 0x00 ) ; request [ 1 ] = ( byte ) ( DirectCommand . PlayTone ) ; SetUInt16 ( frequency , request , 2 ) ; SetUInt16 ( duration , request , 4 ) ; CompleteRequest ( request ) ; return ; }
[Native] Plays a beep tone on the NXT brick.
[ Native ] Plays a beep tone on the NXT brick .
frequency
UInt16
The frequency, in Hz, where frequency is between 200 and 14000 Hz.
The frequency in Hz where frequency is between 200 and 14000 Hz .
duration
UInt16
The duration of the tone, in milliseconds.
The duration of the tone in milliseconds .