DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


built_in:nxt_beep

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

built_in:nxt_beep [2015/03/09 15:43] (current)
octazid created
Line 1: Line 1:
 +====== Beep ======
  
 +The **Beep** function commands the NXT brick to play a tone of a given frequency for a given duration in milliseconds.
 +<​code>​nxt.Beep( frequency, duration );</​code>​
 +
 +====Example - Make the NXT beep====
 +<code javascript>​
 +function OnStart()
 +{
 +  nxt = app.CreateNxt();​
 +  app.SetMenu( "​Connect,​Beep"​ );
 +}
 +
 +function OnMenu( name )
 +{
 +  if( name=="​Connect"​ )
 +    nxt.ShowDevices();​
 +  else if( name=="​Beep"​ )
 +    nxt.Beep( 100, 500 );
 +}
 +</​code>​
built_in/nxt_beep.txt ยท Last modified: 2015/03/09 15:43 by octazid