RWTH - Mindstorms NXT Toolbox

NXT_PlayTone

Plays a tone with the given frequency and duration

Contents

Syntax

NXT_PlayTone(frequency, duration)

NXT_PlayTone(frequency, duration, bt_handle)

Description

NXT_PlayTone(frequency, duration) plays a tone of the frequency in Hz (200 - 14000Hz) and the duration in milli seconds.

NXT_PlayTone(frequency, duration, bt_handle) sends the play tone command over the specific Bluetooth handle (serial handle (PC) / file handle (Linux)).

If no Bluetooth handle is specified the default one (BT_GetDefaultHandle) is used.

For more details see the official LEGO Mindstorms communication protocol.

Examples

   NXT_PlayTone(440, 100);
   bt_handle = BT_OpenHandle('bluetooth.ini','check');
   BT_SetDefaultHandle(bt_handle);
   NXT_PlayTone(1200, 120);

See also

BT_GetDefaultHandle

Signature


Back to RWTH - Mindstorms NXT Toolbox