DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


built_in:nxt_sendmail

Differences

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

Link to this comparison view

built_in:nxt_sendmail [2015/03/09 16:17] (current)
octazid created
Line 1: Line 1:
 +====== SendMail ======
  
 +The **SendMail** function sends a message to the NXT brick'​s mail box. This message can be read using a normal NXT-G program running on the brick. This allows you to communicate with NXT-G programs from your phone or tablet.
 +
 +The **mailbox** parameter is the target mailbox number and can be a value between 1 and 10.
 +
 +The **type** parameter should be one of the following values: "​**Text**",​ "​**Number**"​ or "​**Logic**"​ depending on what type of value you wish to send to the brick'​s mailbox.
 +<​code>​nxt.SendMail( mailbox, type, message );</​code>​
 +
 +====Example - Send message to mailbox 1====
 +<code javascript>​
 +function OnStart()
 +{
 +  nxt = app.CreateNxt();​
 +  app.SetMenu( "​Connect,​SendMail"​ );
 +}
 +
 +function OnMenu( name )
 +{
 +  if( name=="​Connect"​ )
 +    nxt.ShowDevices();​
 +  else if( name=="​SendMail"​ )
 +    nxt.SendMail( 1, "​Text",​ "​Hello"​ );
 +}
 +</​code>​
built_in/nxt_sendmail.txt ยท Last modified: 2015/03/09 16:17 by octazid