Changeset 840
- Timestamp:
- 12/02/09 14:43:17 (3 years ago)
- Location:
- branches/livecd/RWTHMindstormsNXT/doc
- Files:
-
- 92 modified
-
functions/help/COM_CloseNXT.html (modified) (2 diffs)
-
functions/help/COM_CollectPacket.html (modified) (2 diffs)
-
functions/help/COM_CreatePacket.html (modified) (2 diffs)
-
functions/help/COM_GetDefaultNXT.html (modified) (2 diffs)
-
functions/help/COM_MakeBTConfigFile.html (modified) (1 diff)
-
functions/help/COM_OpenNXT.html (modified) (2 diffs)
-
functions/help/COM_OpenNXTEx.html (modified) (2 diffs)
-
functions/help/COM_ReadI2C.html (modified) (2 diffs)
-
functions/help/COM_SendPacket.html (modified) (2 diffs)
-
functions/help/COM_SetDefaultNXT.html (modified) (1 diff)
-
functions/help/CalibrateColor.html (modified) (2 diffs)
-
functions/help/CalibrateCompass.html (modified) (2 diffs)
-
functions/help/CalibrateGyro.html (modified) (2 diffs)
-
functions/help/CloseSensor.html (modified) (1 diff)
-
functions/help/Contents.html (modified) (1 diff)
-
functions/help/DebugMode.html (modified) (2 diffs)
-
functions/help/DirectMotorCommand.html (modified) (2 diffs)
-
functions/help/GetAccelerator.html (modified) (1 diff)
-
functions/help/GetColor.html (modified) (2 diffs)
-
functions/help/GetCompass.html (modified) (1 diff)
-
functions/help/GetGyro.html (modified) (2 diffs)
-
functions/help/GetInfrared.html (modified) (1 diff)
-
functions/help/GetLight.html (modified) (1 diff)
-
functions/help/GetRFID.html (modified) (1 diff)
-
functions/help/GetSound.html (modified) (1 diff)
-
functions/help/GetSwitch.html (modified) (1 diff)
-
functions/help/GetUltrasonic.html (modified) (1 diff)
-
functions/help/MAP_GetCommModule.html (modified) (1 diff)
-
functions/help/MAP_GetInputModule.html (modified) (1 diff)
-
functions/help/MAP_GetOutputModule.html (modified) (1 diff)
-
functions/help/MAP_GetSoundModule.html (modified) (1 diff)
-
functions/help/MAP_GetUIModule.html (modified) (1 diff)
-
functions/help/MAP_SetOutputModule.html (modified) (2 diffs)
-
functions/help/MOTOR_A.html (modified) (1 diff)
-
functions/help/MOTOR_B.html (modified) (1 diff)
-
functions/help/MOTOR_C.html (modified) (1 diff)
-
functions/help/NXC_GetSensorMotorData.html (modified) (1 diff)
-
functions/help/NXC_MotorControl.html (modified) (1 diff)
-
functions/help/NXC_ResetErrorCorrection.html (modified) (2 diffs)
-
functions/help/NXTMotor.html (modified) (2 diffs)
-
functions/help/NXT_GetBatteryLevel.html (modified) (1 diff)
-
functions/help/NXT_GetCurrentProgramName.html (modified) (1 diff)
-
functions/help/NXT_GetFirmwareVersion.html (modified) (1 diff)
-
functions/help/NXT_GetInputValues.html (modified) (1 diff)
-
functions/help/NXT_GetOutputState.html (modified) (1 diff)
-
functions/help/NXT_LSGetStatus.html (modified) (2 diffs)
-
functions/help/NXT_LSRead.html (modified) (2 diffs)
-
functions/help/NXT_LSWrite.html (modified) (2 diffs)
-
functions/help/NXT_MessageRead.html (modified) (2 diffs)
-
functions/help/NXT_MessageWrite.html (modified) (2 diffs)
-
functions/help/NXT_PlaySoundFile.html (modified) (1 diff)
-
functions/help/NXT_PlayTone.html (modified) (2 diffs)
-
functions/help/NXT_ReadIOMap.html (modified) (2 diffs)
-
functions/help/NXT_ResetInputScaledValue.html (modified) (1 diff)
-
functions/help/NXT_ResetMotorPosition.html (modified) (1 diff)
-
functions/help/NXT_SendKeepAlive.html (modified) (2 diffs)
-
functions/help/NXT_SetBrickName.html (modified) (1 diff)
-
functions/help/NXT_SetInputMode.html (modified) (1 diff)
-
functions/help/NXT_SetOutputState.html (modified) (1 diff)
-
functions/help/NXT_StartProgram.html (modified) (1 diff)
-
functions/help/NXT_StopProgram.html (modified) (1 diff)
-
functions/help/NXT_StopSoundPlayback.html (modified) (1 diff)
-
functions/help/NXT_WriteIOMap.html (modified) (2 diffs)
-
functions/help/OpenAccelerator.html (modified) (1 diff)
-
functions/help/OpenColor.html (modified) (1 diff)
-
functions/help/OpenCompass.html (modified) (1 diff)
-
functions/help/OpenGyro.html (modified) (2 diffs)
-
functions/help/OpenInfrared.html (modified) (1 diff)
-
functions/help/OpenLight.html (modified) (1 diff)
-
functions/help/OpenRFID.html (modified) (1 diff)
-
functions/help/OpenSound.html (modified) (1 diff)
-
functions/help/OpenSwitch.html (modified) (1 diff)
-
functions/help/OpenUltrasonic.html (modified) (2 diffs)
-
functions/help/OptimizeToolboxPerformance.html (modified) (1 diff)
-
functions/help/ReadFromNXT.html (modified) (2 diffs)
-
functions/help/ResetPosition.html (modified) (2 diffs)
-
functions/help/SENSOR_1.html (modified) (1 diff)
-
functions/help/SENSOR_2.html (modified) (1 diff)
-
functions/help/SENSOR_3.html (modified) (1 diff)
-
functions/help/SENSOR_4.html (modified) (1 diff)
-
functions/help/SendToNXT.html (modified) (2 diffs)
-
functions/help/Stop.html (modified) (2 diffs)
-
functions/help/StopMotor.html (modified) (2 diffs)
-
functions/help/SwitchLamp.html (modified) (1 diff)
-
functions/help/USGetSnapshotResults.html (modified) (2 diffs)
-
functions/help/USMakeSnapshot.html (modified) (2 diffs)
-
functions/help/WaitFor.html (modified) (2 diffs)
-
functions/help/checkStatusByte.html (modified) (1 diff)
-
functions/help/display.html (modified) (1 diff)
-
functions/help/readFromIniFile.html (modified) (2 diffs)
-
functions/help/textOut.html (modified) (2 diffs)
-
programming/motor_control.html (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_CloseNXT.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_CloseNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_CloseNXT">9 --><title>COM_CloseNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_CloseNXT"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_CloseNXT</h1><!--introduction--><p>Closes and deletes a specific NXT handle, or clears all existing handles</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#7">Description</a></li><li><a href="#13">Limitations</a></li><li><a href="#16">Example</a></li><li><a href="#18">See also</a></li><li><a href="#20">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>COM_CloseNXT(handle)</tt></p><p><tt>COM_CloseNXT('all')</tt></p><p><tt>COM_CloseNXT('all', inifilename)</tt></p><h2>Description<a name="7"></a></h2><p>After using NXT handles, a user should free the device (and the memory occupied by the handle) by calling this method. After the clean up invoked by this call, an NXT brick can be accessed and used again (by <tt>COM_OpenNXT</tt> or <tt>COM_OpenNXTEx</tt>.</p><p><tt>COM_CloseNXT(handle)</tt> will close and erase the specified device. <tt>handle</tt> has to be a valid handle struct created by either <tt>COM_OpenNXT</tt> or <tt>COM_OpenNXTEx</tt>.</p><p><tt>COM_CloseNXT('all')</tt> will close and erase all existing NXT devices from memory (as long as the toolbox could keep track of them). All USB handles will be destroyed, all open serial ports (for Bluetooth connections) will be closed. This can be useful at the beginning of a program to create a "fresh start" and a well-defined starting environment. Please note that a <tt>clear all</tt> command can cause this function to fail (in such a way, that not all open USB devices can be closed, since all information about them has be cleare from MATLAB's memory). If this happens, an NXT device might appear to be busy and cannot be used. Usually rebooting the NXT helps, if not try to restart MATLAB as well. So be careful with using <tt>clear all</tt> before |COM_CloseNXT('all').</p><p><tt>COM_CloseNXT('all', inifilename)</tt> will do the same as above, but instead of closing all open serial ports, only the COM-Port specified in <tt>inifilename</tt> will be used (a valid Bluetooth configuration file can be created by the function <tt>COM_MakeBTConfigFile</tt>). This syntax helps to avoid interference with other serial ports that might be used by other (MATLAB) programs at the same time. Note that still all open USB devices will be closed.</p><h2>Limitations<a name="13"></a></h2><p>If you call <tt>COM_CloseNXT('all')</tt> after a <tt>clear all</tt> command has been issued, the function will not be able to close all remaining open USB handles, since they have been cleared out of memory. This is a problem on Linux systems. You will not be able to use the NXT device without rebooting it. Solution: Either use only <tt>clear</tt> in your programs, or you use the <tt>COM_CloseNXT('all')</tt> statement before <tt>clear all</tt>. The best way however is to track your handles carefully and close them manually before exiting whenever possible!</p><h2>Example<a name="16"></a></h2><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>, check'); … … 13 13 NXT_PlayTone(440,10); 14 14 COM_CloseNXT(handle); 15 </pre><h2>See also<a name="18"></a></h2><p> COM_OpenNXT, COM_OpenNXTEx, COM_MakeBTConfigFile, COM_SetDefaultNXT</p><h2>Signature<a name="20"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="18"></a></h2><p><a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="COM_OpenNXTEx.html">COM_OpenNXTEx</a>, <a href="COM_MakeBTConfigFile.html">COM_MakeBTConfigFile</a>, <a href="COM_SetDefaultNXT.html">COM_SetDefaultNXT</a>, </p><h2>Signature<a name="20"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% COM_CloseNXT -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_CollectPacket.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_CollectPacket</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_CollectPacket">9 --><title>COM_CollectPacket</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_CollectPacket"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_CollectPacket</h1><!--introduction--><p>Reads data from a USB or serial/Bluetooth port, retrieves exactly one packet</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#14">Example</a></li><li><a href="#16">See also</a></li><li><a href="#18">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[type cmd statusbyte content] = COM_CollectPacket(handle)</tt></p><p><tt>[type cmd statusbyte content] = COM_CollectPacket(handle, 'dontcheck')</tt></p><h2>Description<a name="5"></a></h2><p><tt>[type cmd statusbyte content] = COM_CollectPacket(handle)</tt> reads one packet on the communication channel specified by the <tt>handle</tt> struct (PC system: handle struct containing e.g. serial handle, Linux system: handle struct containing file handle). The USB / Bluetooth handle struct can be obtained by the <tt>COM_OpenNXT</tt> or <tt>COM_GetDefaultNXT</tt> command. The return value <tt>type</tt> specifies the telegram type according to the LEGO Mindstorms communication protcol. The <tt>cmd</tt> value determines the specific command. <tt>status</tt> indicates if an error occured on the NXT brick. The function <tt>checkStatusByte</tt> is interpreting this information per default. The <tt>content</tt> column vector represents the remaining payload of the whole return packet. E.g. it contains the current battery level in milli volts, that then has to be converted to a valid integer from its byte representation (i.e. using <tt>wordbytes2dec</tt>).</p><p><tt>[type cmd statusbyte content] = COM_CollectPacket(handle, 'dontcheck')</tt> disables the validation check of the <tt>status</tt> value by function <tt>checkStatusBytes</tt>.</p><p>varargin : set to 'dontcheck' if the status byte should not automatically be checked. Only use this if you expect error messages. Possible usage is for LSGetStatus, where this can happen...</p><p>For more details about the syntax of the return packet see the LEGO Mindstorms communication protocol.</p><p><b>Note:</b></p><p>This function uses the specific Bluetooth settings from the ini-file that was specified when opening the handle. Parameters used here are <tt>SendSendPause</tt> and <tt>SendReceivePause</tt>, which will cause this function to wait a certain amount of milliseconds between each consecutive send or receive operation to avoid packet loss or buffer overflows inside the blutooth stack.</p><h2>Example<a name="14"></a></h2><pre class="codeinput"> COM_MakeBTConfigFile(); … … 22 22 <span class="comment">% Now you could check the statusbyte or interpret the content.</span> 23 23 <span class="comment">% Or maybe check for valid type and cmd before...</span> 24 </pre><h2>See also<a name="16"></a></h2><p> COM_CreatePacket, COM_SendPacket, COM_OpenNXT, COM_GetDefaultNXT, COM_MakeBTConfigFile, checkStatusByte</p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>25 </p></div><!--24 </pre><h2>See also<a name="16"></a></h2><p><a href="COM_CreatePacket.html">COM_CreatePacket</a>, <a href="COM_SendPacket.html">COM_SendPacket</a>, <a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, <a href="COM_MakeBTConfigFile.html">COM_MakeBTConfigFile</a>, <a href="checkStatusByte.html">checkStatusByte</a>, </p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 25 Published with wg_publish; V1.0<br></p></div><!-- 26 26 ##### SOURCE BEGIN ##### 27 27 %% COM_CollectPacket -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_CreatePacket.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_CreatePacket</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_CreatePacket">9 --><title>COM_CreatePacket</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_CreatePacket"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_CreatePacket</h1><!--introduction--><p>Generates a valid Bluetooth packet ready for transmission (i.e. sets length)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#10">Example</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>bytes = COM_CreatePacket(CommandType, Command, ReplyMode, ContentBytes)</tt></p><h2>Description<a name="4"></a></h2><p><tt>bytes = COM_CreatePacket(CommandType, Command, ReplyMode, ContentBytes)</tt> creates a valid Bluetooth packet conform to the LEGO Mindstorms communication protocol. The <tt>CommandType</tt> specifies the telegram type (direct or system command (see the LEGO Mindstorms communication protocol documentation for more details)). This type is determined from the function <tt>name2commandbytes</tt>. The <tt>Command</tt> specifies the actual command according to the LEGO Mindstorms communication protocol. By the <tt>ReplyMode</tt> one can request an acknowledgement for the packet transmission. The two strings <tt>'reply'</tt> and <tt>'dontreply'</tt> are valid. The content byte-array is given by the <tt>ContentBytes</tt>.</p><p>The return value <tt>bytes</tt> represents the complete Bluetooth packet conform to the LEGO Mindstorms Communication protocol.</p><p><b>Note:</b></p><p>The activated <tt>ReplyMode</tt> should only be used if it is necessary. According to the official LEGO statement "Testing during development has shown that the Bluetooth Serial Port communication has some disadvantages when it comes to streaming data. ... One problem is a time penalty (of around 30ms) within the Bluecore chip when switching from receive-mode to transmit-mode. ... To handle the problem of the time penalty within the Bluecore chip, users should send data using Bluetooth without requesting a reply package. This will mean that the Bluecore chip won't have to switch direction for every received package and will not incur a 30ms penalty for every data package."</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> [type cmd] = name2commandbytes(<span class="string">'PLAYTONE'</span>); … … 14 14 15 15 packet = COM_CreatePacket(type, cmd, <span class="string">'dontreply'</span>, content); 16 </pre><h2>See also<a name="12"></a></h2><p> COM_SendPacket, COM_CollectPacket, name2commandbytes, dec2wordbytes</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/09</li><li><b>Copyright:</b> 2007-2009 RWTH Aachen University</li></ul></div><p class="footer"><br>17 </p></div><!--16 </pre><h2>See also<a name="12"></a></h2><p><a href="COM_SendPacket.html">COM_SendPacket</a>, <a href="COM_CollectPacket.html">COM_CollectPacket</a>, <a href="name2commandbytes.html">name2commandbytes</a>, <a href="dec2wordbytes.html">dec2wordbytes</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/09</li><li><b>Copyright:</b> 2007-2009 RWTH Aachen University</li></ul></div><p class="footer"><br> 17 Published with wg_publish; V1.0<br></p></div><!-- 18 18 ##### SOURCE BEGIN ##### 19 19 %% COM_CreatePacket -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_GetDefaultNXT.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_GetDefaultNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_GetDefaultNXT">9 --><title>COM_GetDefaultNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_GetDefaultNXT"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_GetDefaultNXT</h1><!--introduction--><p>Returns the global default NXT handle if it was previously set</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>h = COM_GetDefaultNXT()</tt></p><h2>Description<a name="4"></a></h2><p><tt>h = COM_GetDefaultNXT()</tt> returns the global default NXT handle <tt>h</tt> if it was previously set. The default global NXT handle is used by all NXT-Functions per default if no other handle is specified. To set this global handle the function <tt>COM_SetDefaultNXT</tt> is used.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); … … 13 13 MyNXT = COM_GetDefaultNXT(); 14 14 <span class="comment">% now MyNXT and handle refer to the same device</span> 15 </pre><h2>See also<a name="8"></a></h2><p> COM_SetDefaultNXT, COM_OpenNXT, COM_OpenNXTEx</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/07</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="8"></a></h2><p><a href="COM_SetDefaultNXT.html">COM_SetDefaultNXT</a>, <a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="COM_OpenNXTEx.html">COM_OpenNXTEx</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/07</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% COM_GetDefaultNXT -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_MakeBTConfigFile.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_MakeBTConfigFile</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_MakeBTConfigFile">9 --><title>COM_MakeBTConfigFile</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_MakeBTConfigFile"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_MakeBTConfigFile</h1><!--introduction--><p>Creates a Bluetooth configuration file (needed for Bluetooth connections)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#7">Example</a></li><li><a href="#9">See also</a></li><li><a href="#11">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>COM_MakeBTConfigFile()</tt></p><h2>Description<a name="4"></a></h2><p><tt>COM_MakeBTConfigFile()</tt> starts a user guided dialog window to select the output directory, the file name and the Bluetooth paramters like e.g. COM port.</p><p>The little program creates a specific Bluetooth configuration file for the current PC system. Make sure the configuration file is accessible under MATLAB if you try to open a Bluetooth connection using <tt>COM_OpenNXT</tt> and the correct file name.</p><h2>Example<a name="7"></a></h2><pre class="codeinput"> COM_MakeBTConfigFile(); 12 12 13 13 handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 14 </pre><h2>See also<a name="9"></a></h2><p> COM_OpenNXT, COM_CloseNXT, COM_OpenNXTEx</p><h2>Signature<a name="11"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/09</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="9"></a></h2><p><a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="COM_CloseNXT.html">COM_CloseNXT</a>, <a href="COM_OpenNXTEx.html">COM_OpenNXTEx</a>, </p><h2>Signature<a name="11"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/09</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% COM_MakeBTConfigFile -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_OpenNXT.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_OpenNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_OpenNXT">9 --><title>COM_OpenNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_OpenNXT"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_OpenNXT</h1><!--introduction--><p>Opens USB or Bluetooth connection to NXT device and returns a handle</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Limitations of COM_CloseNXT</a></li><li><a href="#13">Example</a></li><li><a href="#15">See also</a></li><li><a href="#17">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>handle = COM_OpenNXT()</tt></p><p><tt>handle = COM_OpenNXT(inifilename)</tt></p><h2>Description<a name="5"></a></h2><p><tt>handle = COM_OpenNXT()</tt> tries to open a connection via USB. The first NXT device that is found will be used. Device drivers (Fantom on Windows, libusb on Linux) have to be already installed for USB to work.</p><p><tt>handle = COM_OpenNXT(inifilename)</tt> will search the USB bus for NXT devices, just as the syntax without any parameters. If this fails for some reason (no USB connection to the NXT available, no device drivers installed, or NXT device is busy), the function will try to establish a connection via Bluetooth, using the given Bluetooth configuration file (you can create one easily with <tt>COM_MakeBTConfigFile</tt>.</p><p>Note that this function is the most simple way to get an NXT handle. If you need a method to access multiple NXTs or more options, see the advanced function <tt>COM_OpenNXTEx</tt>. In fact, <tt>COM_OpenNXT</tt> is just a convenient wrapper to <tt>COM_OpenNXTEx('Any', ...)</tt>.</p><h2>Limitations of COM_CloseNXT<a name="10"></a></h2><p>If you call <tt>COM_CloseNXT('all')</tt> after a <tt>clear all</tt> command has been issued, the function will not be able to close all remaining open USB handles, since they have been cleared out of memory. This is a problem on Linux systems. You will not be able to use the NXT device without rebooting it. Solution: Either use only <tt>clear</tt> in your programs, or you use the <tt>COM_CloseNXT('all')</tt> statement before <tt>clear all</tt>. The best way however is to track your handles carefully and close them manually (<tt>COM_CloseNXT(handle)</tt>) before exiting whenever possible!</p><h2>Example<a name="13"></a></h2><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); … … 13 13 NXT_PlayTone(440,10); 14 14 COM_CloseNXT(handle); 15 </pre><h2>See also<a name="15"></a></h2><p> COM_OpenNXTEx, COM_CloseNXT, COM_MakeBTConfigFile, COM_SetDefaultNXT</p><h2>Signature<a name="17"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/10</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="15"></a></h2><p><a href="COM_OpenNXTEx.html">COM_OpenNXTEx</a>, <a href="COM_CloseNXT.html">COM_CloseNXT</a>, <a href="COM_MakeBTConfigFile.html">COM_MakeBTConfigFile</a>, <a href="COM_SetDefaultNXT.html">COM_SetDefaultNXT</a>, </p><h2>Signature<a name="17"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/10</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% COM_OpenNXT -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_OpenNXTEx.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_OpenNXTEx</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_OpenNXTEx">9 --><title>COM_OpenNXTEx</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_OpenNXTEx"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_OpenNXTEx</h1><!--introduction--><p>Opens USB or Bluetooth connection to NXT; advanced version, more options</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#10">Description</a></li><li><a href="#28">Limitations of COM_CloseNXT</a></li><li><a href="#31">Examples</a></li><li><a href="#34">See also</a></li><li><a href="#36">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>handle = COM_OpenNXTEx('USB', UseThisNXTMAC)</tt></p><p><tt>handle = COM_OpenNXTEx('Bluetooth', UseThisNXTMAC, inifilename)</tt></p><p><tt>handle = COM_OpenNXTEx('Any', UseThisNXTMAC, inifilename)</tt></p><p><tt>handle = COM_OpenNXTEx('USB' , UseThisNXTMAC, 'MotorControlFilename', motorcontrolfile)</tt></p><p><tt>handle = COM_OpenNXTEx('Bluetooth', UseThisNXTMAC, inifilename, 'MotorControlFilename', motorcontrolfile)</tt></p><p><tt>handle = COM_OpenNXTEx('Any' , UseThisNXTMAC, inifilename, 'MotorControlFilename', motorcontrolfile)</tt></p><h2>Description<a name="10"></a></h2><p>This function establishes a connection to an NXT brick and returns the handle structure that has to be used with NXT-functions (you can call <tt>COM_SetDefaultNXT(handle)</tt> afterwards for easier use).</p><p>For a more convenient way to open an NXT handle with less parameters, the function <tt>COM_OpenNXT</tt> is provided.</p><p>Different types of connection modes are supported. In all modes, you can set <tt>UseThisNXTMAC</tt> to a string with the NXT's MAC address (serial number). A connection will then only be estabslished to a matching NXT brick. This can be useful for programs with multiple NXT devices. Set it to an empty string <tt>''</tt> to use any NXT available (usually the first one found). The string can have the format '001612345678' or '00:16:12:34:56:78'.</p><p><tt>handle = COM_OpenNXTEx('USB', UseThisNXTMAC)</tt></p><p>This will try to open a connection via USB. Device drivers (Fantom on Windows, libusb on Linux) have to be installed.</p><p><tt>handle = COM_OpenNXTEx('Bluetooth', UseThisNXTMAC, inifilename)</tt></p><p>Uses Bluetooth as communication method. A valid inifile containing parameters like the COM-Port has to be specified in <tt>inifilename</tt>. To create an inifile with Bluetooth settings, the function <tt>COM_MakeBTConfigFile</tt> is available.</p><p>Note that as of right now, the parameter <tt>UseThisNXTMAC</tt> will be ignored for Bluetooth connections until implemented in a future version.</p><p><tt>handle = COM_OpenNXTEx('Any', UseThisNXTMAC, inifilename)</tt></p><p>This syntax combines the two parameter settings from above. <tt>inifilename</tt> has to be given. The function will try to locate an NXT device on the USB bus first. If this fails for some reason (no USB connection to the NXT available, no device drivers installed, or NXT device is busy), the function will silently try to establish a connection via Bluetooth.</p><p>The advantage is that this version works with both Bluetooth and USB connections <i>without changing</i> any code. Plug or unplug the USB cable to switch between connection types...</p><p>The optional string-parameter <tt>'MotorControlFilename'</tt> can be used to override the default file name for the embedded NXC program MotorControl, which will be launched by the method. Specify <tt>'MotorControlFilename'</tt>, followed by a the actual filename to be started in <tt>motorcontrolfile</tt>. You can set this to any executable file present on the NXT. The filename conventions are the same as for <tt>NXT_StartProgram</tt>. Set it to an empty string <tt>''</tt> to disable the embedded MotorControl program. In this case, the class <tt>NXTMotor</tt> will not completely be available for usage. This option is intended for advanced users.</p><h2>Limitations of COM_CloseNXT<a name="28"></a></h2><p>If you call <tt>COM_CloseNXT('all')</tt> after a <tt>clear all</tt> command has been issued, the function will not be able to close all remaining open USB handles, since they have been cleared out of memory. This is a problem on Linux systems. You will not be able to use the NXT device without rebooting it. Solution: Either use only <tt>clear</tt> in your programs, or you use the <tt>COM_CloseNXT('all')</tt> statement before <tt>clear all</tt>. The best way however is to track your handles carefully and close them manually (<tt>COM_CloseNXT(handle)</tt>) before exiting whenever possible!%</p><h2>Examples<a name="31"></a></h2><pre class="codeinput"> myNXT = COM_OpenNXTEx(<span class="string">'Any'</span>, <span class="string">'001612345678'</span>, <span class="string">'bluetooth.ini'</span>); … … 19 19 <span class="comment">% default MotorControl program, a custom user file MyProgram.rxe will</span> 20 20 <span class="comment">% try to be launched...</span> 21 </pre><h2>See also<a name="34"></a></h2><p> COM_OpenNXT, COM_CloseNXT, COM_MakeBTConfigFile, COM_SetDefaultNXT</p><h2>Signature<a name="36"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>22 </p></div><!--21 </pre><h2>See also<a name="34"></a></h2><p><a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="COM_CloseNXT.html">COM_CloseNXT</a>, <a href="COM_MakeBTConfigFile.html">COM_MakeBTConfigFile</a>, <a href="COM_SetDefaultNXT.html">COM_SetDefaultNXT</a>, </p><h2>Signature<a name="36"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 22 Published with wg_publish; V1.0<br></p></div><!-- 23 23 ##### SOURCE BEGIN ##### 24 24 %% COM_OpenNXTEx -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_ReadI2C.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_ReadI2C</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_ReadI2C">9 --><title>COM_ReadI2C</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_ReadI2C"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_ReadI2C</h1><!--introduction--><p>Requests and reads sensor data via I2C from a correctly configured digital sensor.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#17">Example</a></li><li><a href="#20">See also</a></li><li><a href="#23">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>ReturnBytes = COM_ReadI2C(Port, RequestLen, DeviceAddress, RegisterAddress)</tt></p><p><tt>ReturnBytes = COM_ReadI2C(Port, RequestLen, DeviceAddress, RegisterAddress, handle)</tt></p><h2>Description<a name="5"></a></h2><p>This function is used to retrieve data from digital sensors (like the ultrasonic) in a comfortable way. It is designed as a helping function for developers wanting to access new sensors. For already implemented sensors (e.g. ultrasound, as well as HiTechnic's acceleration and infrared sensors), use the provided high-level functions such as <tt>GetUltrasonic</tt>, <tt>GetInfrared</tt>, etc.</p><p>For I2C communication, usually the <tt>NXT_SetInputMode</tt> command has to be used with the <tt>LOWSPEED_9V</tt> or <tt>LOWSPEED</tt> setting. Afterwards, commands can be send with <tt>NXT_LSWrite</tt>. Once a sensor is correctly working, i.e. has data available, you can use this function to retrieve them.</p><p>In <tt>COM_ReadI2C(Port, RequestLen, DeviceAddress, RegisterAddress)</tt>, <tt>Port</tt> is the sensor-port the sensor is connected to. <tt>RequestLen</tt> specifies the amount of bytes you want to retrieve. For ultasound, this is 1. <tt>DeviceAddress</tt> is the sensor's address on the I2C bus. This sometimes can be changed, but not for the ultrasonic sensor. Default value is 0x02 (2 in decimal). Finally, <tt>RegisterAddress</tt> is the address where you want to read data from. For the ultrasound and many other sensors, the "data section" starts at 0x42 (66 in decimal).</p><p>As last argument you can pass a valid NXT-handle to be used by this function. If no handle is passed, the default set by <tt>COM_SetDefaultNXT</tt> will be used.</p><p><b>Returns:</b> <tt>ReturnBytes</tt>, byte-array (column vector) of uint8. This array contains the raw sensor-data you requested. How to interpret them depends on the sensor. If communication failed (even after automatic retransmission) -- e.g. when the sensor get's disconnected while in use -- an empty vector <tt>[]</tt> will be returned.</p><p><b>Note:</b></p><p>Please note that the return values of this function are of type uint8. You have to convert them to double (using <tt>double()</tt>) before performing calculations with them, otherwise you might get unexpected results!</p><p>The sensor you are addressing with this command has to be correctly opened and initialized of course -- otherwise no valid data can be received.</p><h2>Example<a name="17"></a></h2><p>This example opens and reads the ultrasonic sensor</p><pre class="codeinput"> port = SENSOR_1; … … 23 23 DistanceCM = double(data(1)); 24 24 <span class="keyword">end</span><span class="comment">%if</span> 25 </pre><h2>See also<a name="20"></a></h2><p> NXT_LSWrite, NXT_LSRead, NXT_LSGetStatus, NXT_SetInputMode, OpenUltrasonic, GetUltrasonic, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="23"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/23</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>26 </p></div><!--25 </pre><h2>See also<a name="20"></a></h2><p><a href="NXT_LSWrite.html">NXT_LSWrite</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, <a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="OpenUltrasonic.html">OpenUltrasonic</a>, <a href="GetUltrasonic.html">GetUltrasonic</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="23"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/23</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 26 Published with wg_publish; V1.0<br></p></div><!-- 27 27 ##### SOURCE BEGIN ##### 28 28 %% COM_ReadI2C -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_SendPacket.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_SendPacket</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_SendPacket">9 --><title>COM_SendPacket</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_SendPacket"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_SendPacket</h1><!--introduction--><p>Sends a communication protocol packet (byte-array) via a USB or Bluetooth</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#10">Example</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>COM_SendPacket(Packet, handle)</tt></p><h2>Description<a name="4"></a></h2><p><tt>COM_SendPacket(Packet, handle)</tt> sends the given byte-array <tt>Packet</tt> (column vector), (which can easily be created by the function <tt>COM_CreatePacket</tt>) over the USB or Bluetooth channel specified by the given <tt>handle</tt> (struct) created by the function <tt>COM_OpenNXT</tt> or <tt>COM_OpenNXTEx</tt>, or obtained from <tt>COM_GetDefaultNXT</tt>.</p><p><b>Note:</b></p><p>In the case of a Bluetooth connection this function uses the specific settings from the ini-file that was specified when opening the handle. Parameters used here are <tt>SendSendPause</tt> and <tt>SendReceivePause</tt>, which will cause this function to wait a certain amount of milliseconds between each consecutive send or receive operation to avoid packet loss or buffer overflows inside the blutooth stack.</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> COM_MakeBTConfigFile(); … … 18 18 19 19 COM_SendPacket(packet, bt_handle); 20 </pre><h2>See also<a name="12"></a></h2><p> COM_CreatePacket, COM_CollectPacket, COM_OpenNXT, COM_GetDefaultNXT, COM_MakeBTConfigFile</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>21 </p></div><!--20 </pre><h2>See also<a name="12"></a></h2><p><a href="COM_CreatePacket.html">COM_CreatePacket</a>, <a href="COM_CollectPacket.html">COM_CollectPacket</a>, <a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, <a href="COM_MakeBTConfigFile.html">COM_MakeBTConfigFile</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 21 Published with wg_publish; V1.0<br></p></div><!-- 22 22 ##### SOURCE BEGIN ##### 23 23 %% COM_SendPacket -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/COM_SetDefaultNXT.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>COM_SetDefaultNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_COM_SetDefaultNXT">9 --><title>COM_SetDefaultNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_COM_SetDefaultNXT"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>COM_SetDefaultNXT</h1><!--introduction--><p>Sets global default NXT handle (will be used by other functions as default)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>COM_SetDefaultNXT(h)</tt></p><h2>Description<a name="4"></a></h2><p><tt>COM_SetDefaultNXT(h)</tt> sets the given handle <tt>h</tt> to the global NXT handle, which is used by all NXT-Functions per default if no other handle is specified. To create and open an NXT handle (Bluetooth or USB), the functions <tt>COM_OpenNXT</tt> and <tt>COM_OpenNXTEx</tt> can be used. To retrieve the global default handle user <tt>COM_GetDefaultNXT</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> MyNXT = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 12 12 COM_SetDefaultNXT(MyNXT); 13 </pre><h2>See also<a name="8"></a></h2><p> COM_GetDefaultNXT, COM_OpenNXT, COM_OpenNXTEx</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/07</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, <a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="COM_OpenNXTEx.html">COM_OpenNXTEx</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/07</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% COM_SetDefaultNXT -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/CalibrateColor.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>CalibrateColor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_CalibrateColor">9 --><title>CalibrateColor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_CalibrateColor"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>CalibrateColor</h1><!--introduction--><p>Enables calibration mode of the HiTechnic color sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Example</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>CalibrateColor(port, mode)</tt></p><p><tt>CalibrateColor(port, mode, handle)</tt></p><h2>Description<a name="5"></a></h2><p>Calibrate the color sensor with white balance and black value. I don't know whether calibration of color sensor makes sence Hitech doku says nothing, some internet freaks say it is necessary, but it works and has effect ;-) The sensor LEDs make a short flash after successful calibration. When calibrated, the sensor keeps this information in non-volatile memory. There are two different modes for calibration: <tt>mode</tt> = 1: white balance calibration Puts the sensor into white balance calibration mode. For best results the sensor should be pointed at a diffuse white surface at a distance of approximately 15mm before calling this method. After a fraction of a second the sensor lights will flash and the calibration is done. <tt>mode</tt> = 2: black level calibration Puts the sensor into black/ambient level calibration mode. For best results the sensor should be pointed in a direction with no obstacles for 50cm or so. This reading the sensor will use as a base level for other readings. After a fraction of a second the sensor lights will flash and the calibration is done. When calibrated, the sensor keeps this information in non-volatile memory.</p><p>The color sensor has to be opened (using <tt>OpenColor</tt>) before execution.</p><p>The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> <span class="comment">% color must be open for calibration</span> … … 18 18 <span class="comment">% black calibration mode</span> 19 19 CalibrateColor(SENSOR_2, 2); 20 </pre><h2>See also<a name="12"></a></h2><p> OpenColor, GetColor, CloseSensor</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>21 </p></div><!--20 </pre><h2>See also<a name="12"></a></h2><p><a href="OpenColor.html">OpenColor</a>, <a href="GetColor.html">GetColor</a>, <a href="CloseSensor.html">CloseSensor</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 21 Published with wg_publish; V1.0<br></p></div><!-- 22 22 ##### SOURCE BEGIN ##### 23 23 %% CalibrateColor -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/CalibrateCompass.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>CalibrateCompass</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_CalibrateCompass">9 --><title>CalibrateCompass</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_CalibrateCompass"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>CalibrateCompass</h1><!--introduction--><p>Enables calibration mode of the HiTechnic compass sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Example</a></li><li><a href="#14">See also</a></li><li><a href="#16">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>CalibrateCompass(port, f_start)</tt></p><p><tt>CalibrateCompass(port, f_start, handle)</tt></p><h2>Description<a name="5"></a></h2><p>Calibrate the compass to reduce influence of metallic objects, especially of the NXT motor and brick on compass values. You have to calibrate a roboter only once until the design changes. During calibration the compass should make two full rotations very slowly. The compass sensor has to be opened (using <tt>OpenCompass</tt>) before execution.</p><p>Set <tt>f_start = true</tt> to start calibration mode, and <tt>f_start = false</tt> to stop it. In between those commands, the calibration (compass rotation) should occur.</p><p>The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> <span class="comment">% compass must be open for calibration</span> … … 23 23 <span class="comment">% calibration should now be complete!</span> 24 24 CalibrateCompass(SENSOR_2, false); 25 </pre><h2>See also<a name="14"></a></h2><p> OpenCompass, GetCompass, CloseSensor, NXT_LSRead, NXT_LSWrite</p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>26 </p></div><!--25 </pre><h2>See also<a name="14"></a></h2><p><a href="OpenCompass.html">OpenCompass</a>, <a href="GetCompass.html">GetCompass</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, <a href="NXT_LSWrite.html">NXT_LSWrite</a>, </p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 26 Published with wg_publish; V1.0<br></p></div><!-- 27 27 ##### SOURCE BEGIN ##### 28 28 %% CalibrateCompass -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/CalibrateGyro.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>CalibrateGyro</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_CalibrateGyro">9 --><title>CalibrateGyro</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_CalibrateGyro"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>CalibrateGyro</h1><!--introduction--><p>Calibrates the HiTechnic Gyro sensor (measures/sets an offset while in rest)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#7">Description</a></li><li><a href="#18">Examples</a></li><li><a href="#22">See also</a></li><li><a href="#24">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>offset = CalibrateGyro(port, 'AUTO')</tt></p><p><tt>offset = CalibrateGyro(port, 'AUTO', handle)</tt></p><p><tt>offset = CalibrateGyro(port, 'MANUAL', manualOffset)</tt></p><p><tt>offset = CalibrateGyro(port, 'MANUAL', manualOffset, handle)</tt></p><h2>Description<a name="7"></a></h2><p>In order to use the HiTechnic Gyro Sensor, it has first to be opened using <tt>OpenGyro</tt>. Then <tt>CalibrateGyro</tt> should be called (or a warning will be issued). Only after this you can safely use <tt>GetGyro</tt> to retrieve values.</p><p>This function will set (and return) the new offset (i.e. reading during reast) of the according Gyro sensor. Normally users should use the</p><p><b>automatic</b> calibration mode: <tt>offset = CalibrateGyro(port, 'AUTO')</tt></p><p>The offset will be calculated automatically. During this function the Gyro sensor value will be measured for at least 1 second (or for at least 5 times). During this period, the sensor must be at full rest!</p><p>If you want to save time during your program with a well-known Gyro sensor, or you cannot assure that the sensor is at rest during calibration, you can use the automatic calibration once in the command line and remember the determined offset value. Using manual calibration, you can then set a hardcoded value manually (saving you time and the calibration for this sensor in the future in that specific program).</p><p>Use <tt>CalibrateGyro(port, 'MANUAL', manualOffset)</tt> to achieve this, with a correct offset obtained from automatic calibration. This call won't require that the sensor doesn't move. Also the call is very fast (as compared to at least 1 second in automatic mode). Use integers for <tt>manualOffset</tt>, as the gyro sensor is only accurate to +/- 1 degree per second anyway.</p><p>The last optional argument (for both modes) can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p><b>Note:</b></p><p>Manual calibration only works for one specific sensor (i.e. one unique piece of hardware). Other sensors might have different offsets. Also it could be possible that the offset changes over time or is dependent on your working environment (humidity, temperature, etc).</p><h2>Examples<a name="18"></a></h2><pre class="codeinput"> <span class="comment">% in this example the gyro is used with automatic</span> … … 38 38 CalibrateGyro(SENSOR_1, <span class="string">'MANUAL'</span>, offset); 39 39 <span class="comment">% ready to use GetGyro now...</span> 40 </pre><h2>See also<a name="22"></a></h2><p> OpenGyro, GetGyro, CloseSensor, NXT_SetInputMode, NXT_GetInputValues</p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/04/14</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>41 </p></div><!--40 </pre><h2>See also<a name="22"></a></h2><p><a href="OpenGyro.html">OpenGyro</a>, <a href="GetGyro.html">GetGyro</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, </p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/04/14</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 41 Published with wg_publish; V1.0<br></p></div><!-- 42 42 ##### SOURCE BEGIN ##### 43 43 %% CalibrateGyro -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/CloseSensor.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>CloseSensor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_CloseSensor">9 --><title>CloseSensor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_CloseSensor"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>CloseSensor</h1><!--introduction--><p>Closes a sensor port (e.g. turns off active light of the light sensor)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#8">Examples</a></li><li><a href="#10">See also</a></li><li><a href="#12">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>CloseSensor(port)</tt></p><p><tt>CloseSensor(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>CloseSensor(port)</tt> closes the sensor <tt>port</tt> opened by the <tt>Open...</tt> functions. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. Closing the light sensor deactives the active light mode (the red light is turned off), closing the Ultrasonic sensor stops sending out ultrasound.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Examples<a name="8"></a></h2><pre class="codeinput"> OpenLight(SENSOR_3, <span class="string">'ACTIVE'</span>); 12 12 light = GetLight(SENSOR_3); 13 13 CloseSensor(SENSOR_3); 14 </pre><h2>See also<a name="10"></a></h2><p> NXT_SetInputMode, OpenLight, OpenSound, OpenSwitch, OpenUltrasonic, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="10"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="OpenLight.html">OpenLight</a>, <a href="OpenSound.html">OpenSound</a>, <a href="OpenSwitch.html">OpenSwitch</a>, <a href="OpenUltrasonic.html">OpenUltrasonic</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% CloseSensor -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/Contents.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>Contents</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="Contents">9 --><title>Contents</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="Contents"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><pre class="codeinput"><span class="comment">% @NXTMOTOR</span> -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/DebugMode.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>DebugMode</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_DebugMode">9 --><title>DebugMode</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_DebugMode"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>DebugMode</h1><!--introduction--><p>Gets or sets debug state (i.e. if textOut prints messages to the command window)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#6">Description</a></li><li><a href="#12">Example</a></li><li><a href="#16">See also</a></li><li><a href="#18">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>state = DebugMode();</tt></p><p><tt>DebugMode(state);</tt></p><h2>Description<a name="6"></a></h2><p>The function <tt>textOut</tt> can be used to display text messages inside the command window. These messages can optionally be logged to a file (see textOut for details) or the output can be disable. To turn off those debug messages, the global variable <tt>DisableScreenOut</tt> had to be modified in earlier toolbox versions. Now the function <tt>DebugMode</tt> provides easier access.</p><p><tt>state = DebugMode();</tt> returns the current debug state, the return value is either <tt>'on'</tt> or <tt>'off'</tt>.</p><p><tt>DebugMode(state);</tt> is used to switch between displaying messages and silent mode. The paramter <tt>state</tt> has to be <tt>'on'</tt> or <tt>'off'</tt>.</p><p>Note: If you need a fast alternative to <tt>strcmpi(DebugMode(), 'on')</tt>, please consider the private toolbox function <tt>isdebug</tt>.</p><h2>Example<a name="12"></a></h2><pre class="codeinput"> <span class="comment">% enable debug messages</span> … … 17 17 <span class="comment">% restore previous setting</span> 18 18 DebugMode(oldState); 19 </pre><h2>See also<a name="16"></a></h2><p> textOut, isdebug (private)</p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/04</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>20 </p></div><!--19 </pre><h2>See also<a name="16"></a></h2><p><a href="textOut.html">textOut</a>, <a href="isdebug (private).html">isdebug (private)</a>, </p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/07/04</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 20 Published with wg_publish; V1.0<br></p></div><!-- 21 21 ##### SOURCE BEGIN ##### 22 22 %% DebugMode -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/DirectMotorCommand.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>DirectMotorCommand</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_DirectMotorCommand">9 --><title>DirectMotorCommand</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_DirectMotorCommand"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>DirectMotorCommand</h1><!--introduction--><p>Sends a direct command to the specified motor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#13">Limitations:</a></li><li><a href="#17">Examples</a></li><li><a href="#22">See also</a></li><li><a href="#24">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>DirectMotorCommand(port, power, angle, speedRegulation, syncedToMotor, turnRatio, rampMode)</tt></p><h2>Description<a name="5"></a></h2><p><tt>DirectMotorCommand(port, power, angle, speedRegulation, syncedToMotor, turnRatio, rampMode)</tt> sends the given settings like motor <tt>port</tt> (<tt>MOTOR_A</tt>, <tt>MOTOR_B</tt> or <tt>MOTOR_C</tt>), the <tt>power</tt> (<tt>-100...100</tt>), the <tt>angle</tt> limit (also called TachoLimit), <tt>speedRegulation</tt> (<tt>'on'</tt>, <tt>'off'</tt>), <tt>syncedToMotor</tt> (<tt>MOTOR_A</tt>, <tt>MOTOR_B</tt>, <tt>MOTOR_C</tt>), <tt>turnRatio</tt> (<tt>-100...100</tt>) and <tt>rampMode</tt> (<tt>'off'</tt>, <tt>'up'</tt>, <tt>'down'</tt>).</p><p>This function is basically a convenient wrapper for <tt>NXT_SetOutputState</tt>. It provides the fastest way possible to send a direct command to the motor(s) via Bluetooth or USB. Complex parameter combinations which are needed for speed regulation or synchronous driving when using <tt>NXT_SetOutputState</tt> are not necessary, this function does make sure the motor "just works". See below for examples.</p><p><b>Note:</b></p><p>When driving synced motors, it's recommended to stop the motors between consecutive direct motor command (using <tt>StopMotor</tt>) and to reset their position counters (using <tt>NXT_ResetMotorPosition</tt>).</p><p>This function is intended for the advanced user. Knowledge about the LEGO MINDSTORMS NXT Bluetooth Communication Protocol is not required, but can help to understand what this function does.</p><h2>Limitations:<a name="13"></a></h2><p>Generally spoken, using <tt>DirectMotorCommand</tt> together with the class <tt>NXTMotor</tt> (and its method <tt>SendToNXT</tt>) for the same motor is strongly discouraged. This function can interfer with the on-brick embedded NXC program MotorControl and could cause it to crash. It ignores whatever is happening on the NXT when sending the direct command. The only advantage is the low latency.</p><p>When using the parameter <tt>angleLimit</tt>, the motor tries to reach the desired position by turning off the power at the specified position. This will lead to overshooting of the motor (i.e. the position it stops will be too high or too low). Additionally, the LEGO firmware applies an error correction mechanism which can lead to confusing results. Please look inside the chapter "Troubleshooting" of this toolbox documentation for more details.</p><h2>Examples<a name="17"></a></h2><pre class="codeinput"> <span class="comment">% let a driving robot go straight a bit.</span> … … 25 25 m = NXTMotor(<span class="string">'A'</span>); 26 26 m.Stop(<span class="string">'off'</span>); 27 </pre><h2>See also<a name="22"></a></h2><p> NXT_SetOutputState, NXT_GetOutputState, NXTMotor, SendToNXT, Stop, StopMotor</p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/08/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>28 </p></div><!--27 </pre><h2>See also<a name="22"></a></h2><p><a href="NXT_SetOutputState.html">NXT_SetOutputState</a>, <a href="NXT_GetOutputState.html">NXT_GetOutputState</a>, <a href="NXTMotor.html">NXTMotor</a>, <a href="SendToNXT.html">SendToNXT</a>, <a href="Stop.html">Stop</a>, <a href="StopMotor.html">StopMotor</a>, </p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/08/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 28 Published with wg_publish; V1.0<br></p></div><!-- 29 29 ##### SOURCE BEGIN ##### 30 30 %% DirectMotorCommand -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetAccelerator.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetAccelerator</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetAccelerator">9 --><title>GetAccelerator</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetAccelerator"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetAccelerator</h1><!--introduction--><p>Reads the current value of the HiTechnic acceleration sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#8">Example</a></li><li><a href="#10">See also</a></li><li><a href="#12">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>acc_vector = GetAccelerator(port)</tt></p><p><tt>acc_vector = GetAccelerator(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>acc_vector = GetAccelerator(port)</tt> returns the current 1x3 accelerator vector <tt>acc_vector</tt> of the HiTechnic acceleration sensor. The column vector contains the readings of the x, y, and z-axis, respectively. A reading of 200 is equal to the acceleration of 1g. Maximum range is -2g to +2g. The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Example<a name="8"></a></h2><pre class="codeinput"> OpenAccelerator(SENSOR_4); 12 12 acc_Vector = GetAccelerator(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="10"></a></h2><p> OpenAccelerator, CloseSensor, COM_ReadI2C</p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="10"></a></h2><p><a href="OpenAccelerator.html">OpenAccelerator</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, </p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetAccelerator -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetColor.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetColor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetColor">9 --><title>GetColor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetColor"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetColor</h1><!--introduction--><p>Reads the current value of the HiTechnic Color sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#12">Example</a></li><li><a href="#14">See also</a></li><li><a href="#16">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[index r g b] = GetColor(port)</tt></p><p><tt>[index r g b] = GetColor(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>degree = GetColor(port)</tt> returns the index color value and the RGB-values of the HiTechnic Color sensor. The color index for mode=0 and mode=1 corresponds to the following table, but the color values don't be pure RGB-values. Tests give best results for RGB-colors in brackets:</p><pre class="codeinput"><span class="comment">% 0 = black (0-0-0)</span> … … 25 25 [index r g b] = GetColor(SENSOR_4, 0); 26 26 CloseSensor(SENSOR_4); 27 </pre><h2>See also<a name="14"></a></h2><p> OpenColor, CalibrateColor, CloseSensor, COM_ReadI2C</p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/10/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>28 </p></div><!--27 </pre><h2>See also<a name="14"></a></h2><p><a href="OpenColor.html">OpenColor</a>, <a href="CalibrateColor.html">CalibrateColor</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, </p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/10/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 28 Published with wg_publish; V1.0<br></p></div><!-- 29 29 ##### SOURCE BEGIN ##### 30 30 %% GetColor -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetCompass.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetCompass</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetCompass">9 --><title>GetCompass</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetCompass"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetCompass</h1><!--introduction--><p>Reads the current value of the HiTechnic compass sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Example</a></li><li><a href="#11">See also</a></li><li><a href="#13">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>degree = GetCompass(port)</tt></p><p><tt>degree = GetCompass(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>degree = GetCompass(port)</tt> returns the current heading value of the HiTechnic magnetic compass sensor ranging from 0 to 360 where 0 is north and counterclockwise (90 = west etc.). The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>For more complex settings the functions <tt>NXT_LSRead</tt> and <tt>NXT_LSWrite</tt> can be used.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Example<a name="9"></a></h2><pre class="codeinput"> OpenCompass(SENSOR_4); 12 12 degree = GetCompass(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="11"></a></h2><p> OpenCompass, CalibrateCompass, CloseSensor, COM_ReadI2C</p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="11"></a></h2><p><a href="OpenCompass.html">OpenCompass</a>, <a href="CalibrateCompass.html">CalibrateCompass</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, </p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetCompass -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetGyro.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetGyro</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetGyro">9 --><title>GetGyro</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetGyro"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetGyro</h1><!--introduction--><p>Reads the current value of the HiTechnic Gyro sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Example</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>angularVelocity = GetGyro(port)</tt></p><p><tt>angularVelocity = GetGyro(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>angularVelocity = GetGyro(port)</tt> returns the current rotational speed detected by the HiTechnic Gyroscopic sensor. Maximum range is from -360 to 360 degrees per second (according to HiTechnic documentation), however greater values have been observed. Returned values are accurate to +/- 1 degree.</p><p>Integration over time gives the rotational position (in degrees). Tests give quite good results. The given port number specifies the connection port. The value port can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>Before using this function, the gyro sensor must be initialized using <tt>OpenGyro</tt> and calibrated using <tt>CalibrateGyro</tt>.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> OpenGyro(SENSOR_2); … … 13 13 speed = GetGyro(SENSOR_2); 14 14 CloseSensor(SENSOR_2); 15 </pre><h2>See also<a name="12"></a></h2><p> OpenGyro, CalibrateGyro, CloseSensor, NXT_SetInputMode, NXT_GetInputValues</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="12"></a></h2><p><a href="OpenGyro.html">OpenGyro</a>, <a href="CalibrateGyro.html">CalibrateGyro</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% GetGyro -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetInfrared.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetInfrared</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetInfrared">9 --><title>GetInfrared</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetInfrared"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetInfrared</h1><!--introduction--><p>Reads the current value of the Hitechnic infrared sensor (infrared seeker)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Example</a></li><li><a href="#11">See also</a></li><li><a href="#13">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[direction rawData] = GetInfrared(port)</tt></p><p><tt>[direction rawData] = GetInfrared(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>[direction rawData] = GetInfrared(port)</tt> returns the current direction an the raw data of the detected infrared signal. <tt>direction</tt> represents the main direction (1-9) calculated based on the measured raw data given in the <tt>rawData</tt> vector (1x5). Five sensors are provided by the infrared seeker. For more information see <a href="http://www.hitechnic.com">http://www.hitechnic.com</a></p><p>The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Example<a name="9"></a></h2><pre class="codeinput"> OpenInfrared(SENSOR_4); 12 12 [direction rawData] = GetInfrared(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="11"></a></h2><p> OpenInfrared, CloseSensor, COM_ReadI2C</p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="11"></a></h2><p><a href="OpenInfrared.html">OpenInfrared</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, </p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetInfrared -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetLight.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetLight</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetLight">9 --><title>GetLight</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetLight"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetLight</h1><!--introduction--><p>Reads the current value of the NXT light sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Examples</a></li><li><a href="#11">See also</a></li><li><a href="#13">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>light = GetLight(port)</tt></p><p><tt>light = GetLight(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>light = GetLight(port)</tt> returns the current light value <tt>light</tt> of the NXT light sensor. The measurement value <tt>light</tt> represents the normalized (default) sound value (0..1023 / 10 Bit). The normalized value mode is set per default by the function <tt>OpenLight</tt>. The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>For more complex settings the function <tt>NXT_GetInputValues</tt> can be used.</p><h2>Examples<a name="9"></a></h2><pre class="codeinput"> OpenLight(SENSOR_1, <span class="string">'ACTIVE'</span>); 12 12 light = GetLight(SENSOR_1); 13 13 CloseSensor(SENSOR_1); 14 </pre><h2>See also<a name="11"></a></h2><p> NXT_GetInputValues, OpenLight, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/05</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="11"></a></h2><p><a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, <a href="OpenLight.html">OpenLight</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/05</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetLight -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetRFID.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetRFID</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetRFID">9 --><title>GetRFID</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetRFID"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetRFID</h1><!--introduction--><p>Reads the transponder ID detected by the Codatex RFID sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#13">Example</a></li><li><a href="#15">See also</a></li><li><a href="#17">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>transpID = GetRFID(port)</tt></p><p><tt>transpID = GetRFID(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>transpID = GetRFID(port)</tt> returns a 5-byte transponder ID (datatype is uint64). The given port number specifies the connection port. The value port can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p><b>Note:</b></p><p>The RFID-tag should be placed in a distance of about 1 to 3cm from the RFID sensor. If the transponder was successfully detected, the orange LED of the sensor will flash. Very rarely, when operating with multiple ID tags close to each other, an ID might not be read correctly (in this case it's usually easy to spot, as it looks very different from the "usual" tag IDs).</p><p>Please also note that this function returns about 3 to 5 readings per second when used with USB. Bia Bluetooth however, a single function call can take as long as 1 second, depending on connection quality.</p><h2>Example<a name="13"></a></h2><pre class="codeinput"> OpenRFID(SENSOR_2); 12 12 transID = GetRFID(SENSOR_2); 13 13 CloseSensor(SENSOR_2); 14 </pre><h2>See also<a name="15"></a></h2><p> OpenRFID, CloseSensor</p><h2>Signature<a name="17"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/12/1</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="15"></a></h2><p><a href="OpenRFID.html">OpenRFID</a>, <a href="CloseSensor.html">CloseSensor</a>, </p><h2>Signature<a name="17"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/12/1</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetRFID -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetSound.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetSound</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetSound">9 --><title>GetSound</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetSound"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetSound</h1><!--introduction--><p>Reads the current value of the NXT sound sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Example</a></li><li><a href="#11">See also</a></li><li><a href="#13">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>sound = GetSound(port)</tt></p><p><tt>sound = GetSound(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>sound = GetSound(port)</tt> returns the current sound value <tt>sound</tt> of the NXT sound sensor. The measurement value <tt>sound</tt> represents the normalized (default) sound value (0..1023 / 10 Bit). The normalized value mode is set per default by the function <tt>OpenSound</tt>. The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>For more complex settings the function <tt>NXT_GetInputMode</tt> can be used.</p><h2>Example<a name="9"></a></h2><pre class="codeinput"> OpenSound(SENSOR_1, <span class="string">'DB'</span>); 12 12 sound = GetSound(SENSOR_1); 13 13 CloseSensor(SENSOR_1); 14 </pre><h2>See also<a name="11"></a></h2><p> NXT_SetInputMode, OpenLight, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/05</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="11"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="OpenLight.html">OpenLight</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/05</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetSound -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetSwitch.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetSwitch</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetSwitch">9 --><title>GetSwitch</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetSwitch"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetSwitch</h1><!--introduction--><p>Reads the current value of the NXT switch / touch sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Example</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>switch = GetSwitch(port)</tt></p><p><tt>switch = GetSwitch(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>switch = GetSwitch(port)</tt> returns the current switch value <tt>switch</tt> of the NXT switch / touch sensor. The measurement value <tt>switch</tt> represents the pressing mode of the switch / touch sensor. <tt>true</tt> is returned if the switch / touch sensor is being pressed and <tt>false</tt> if it is being released. The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>For more complex settings the function <tt>NXT_GetInputValues</tt> can be used.</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> OpenSwitch(SENSOR_4); 12 12 switchState = GetSwitch(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="12"></a></h2><p> NXT_GetInputValues, OpenSwitch, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/05</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="12"></a></h2><p><a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, <a href="OpenSwitch.html">OpenSwitch</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/05</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetSwitch -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/GetUltrasonic.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>GetUltrasonic</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_GetUltrasonic">9 --><title>GetUltrasonic</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_GetUltrasonic"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>GetUltrasonic</h1><!--introduction--><p>Reads the current value of the NXT ultrasonic sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#14">Limitations</a></li><li><a href="#18">Example</a></li><li><a href="#20">See also</a></li><li><a href="#22">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>distance = GetUltrasonic(port)</tt></p><p><tt>distance = GetUltrasonic(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>distance = GetUltraSonic(port)</tt> returns the current measurement value <tt>distance</tt> of the NXT ultrasonic sensor. <tt>distance</tt> represents the measured distance in cm. If no echo can be detected (which could indicate that either there is no obstacle in the way, or the ultrasound does not get reflected, e.g. by fur-like surfaces), the reading will be 255. If no measurement can be made (defect sensor, cable disconnected, etc.), a value of -1 will be returned.</p><p>The given <tt>port</tt> number specifies the connection port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p><b>Note:</b></p><p>This function only works when the sensor was correctly opened with <tt>OpenUltrasonic(port)</tt>. If the sensor is being used in snapshot mode, <tt>GetUltrasonic</tt> will not work correctly!</p><p>For different uses, see also <tt>OpenUltrasonic(port, 'snapshot')</tt> and the functions <tt>USMakeSnapshot</tt> and <tt>USGetSnapshotResults</tt>.</p><h2>Limitations<a name="14"></a></h2><p>Since the Ultrasonic sensors all operate at the same frequency, multiple US sensors will interfere with each other! If multiple US sensors can "see each other" (or their echos and reflections), results will be unpredictable (and probably also unusable). You can avoid this problem by turning off US sensors, or operating them in snapshot mode (see also <tt>USMakeSnapshot</tt> and <tt>USGetSnapshotResults</tt>).</p><p>Due to the speed of sound in air, the ultrasonic sensor needs a certain amount of time to complete a successful measurement. This is why the maximum polling rate has been limited to 50 Hz (i.e. a call will take 20ms if called too often). This is only relevant for fast USB connections.</p><h2>Example<a name="18"></a></h2><pre class="codeinput"> OpenUltrasonic(SENSOR_4); 12 12 distance = GetUltrasonic(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="20"></a></h2><p> OpenUltrasonic, USMakeSnapshot, USGetSnapshotResults, CloseSensor, NXT_LSRead, NXT_LSWrite</p><h2>Signature<a name="22"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="20"></a></h2><p><a href="OpenUltrasonic.html">OpenUltrasonic</a>, <a href="USMakeSnapshot.html">USMakeSnapshot</a>, <a href="USGetSnapshotResults.html">USGetSnapshotResults</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, <a href="NXT_LSWrite.html">NXT_LSWrite</a>, </p><h2>Signature<a name="22"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% GetUltrasonic -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MAP_GetCommModule.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MAP_GetCommModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MAP_GetCommModule">9 --><title>MAP_GetCommModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MAP_GetCommModule"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MAP_GetCommModule</h1><!--introduction--><p>Reads the IO map of the communication module</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#35">Examples</a></li><li><a href="#37">See also</a></li><li><a href="#39">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>map = MAP_GetCommModule()</tt></p><h2>Description<a name="4"></a></h2><p><tt>map = MAP_GetCommModule()</tt> returns the IO map of the communication module. The return value <tt>map</tt> is a struct variable. It contains all communication module information.</p><p><b>Output:</b></p><p><tt>map.PFunc</tt> % ?</p><p><tt>map.PFuncTwo</tt> % ?</p><p><tt>map.BTPort</tt> % 1x4 cell array contains Bluetooth device information of each NXT Bluetooth port (i = 0..3)</p><p><tt>map.BTPort{i}.BtDeviceTableName</tt> % name of the Bluetooth device</p><p><tt>map.BTPort{i}.BtDeviceTableClassOfDevice</tt> % class of the Bluetooth device</p><p><tt>map.BTPort{i}.BtDeviceTableBdAddr</tt> % MAC address of the Bluetooth device</p><p><tt>map.BTPort{i}.BtDeviceTableDeviceStatus</tt> % status of the Bluetooth device</p><p><tt>map.BTPort{i}.BtConnectTableName</tt> % name of the connected Bluetooth device</p><p><tt>map.BTPort{i}.BtConnectTableClassOfDevice</tt> % class of the connected Bluetooth device</p><p><tt>map.BTPort{i}.BtConnectTablePinCode</tt> % pin code of the connected Bluetooth device</p><p><tt>map.BTPort{i}.BtConnetTableBdAddr</tt> % MAC address of the connected Bluetooth device</p><p><tt>map.BTPort{i}.BtConnectTableHandleNr</tt> % handle nr of the connected Bluetooth device</p><p><tt>map.BTPort{i}.BtConnectTableStreamStatus</tt> % stream status of the connected Bluetooth device</p><p><tt>map.BTPort{i}.BtConnectTableLinkQuality</tt> % link quality of the connected Bluetooth device</p><p><tt>map.BrickDataName</tt> % name of the NXT brick</p><p><tt>map.BrickDataBluecoreVersion</tt> % Bluecore version number</p><p><tt>map.BrickDataBdAddr</tt> % MAC address of the NXT brick</p><p><tt>map.BrickDataBtStateStatus</tt> % Bluetooth state status</p><p><tt>map.BrickDataBtHwStatus</tt> % NXT hardware status</p><p><tt>map.BrickDataTimeOutValue</tt> % time out value</p><p><tt>map.BtDeviceCnt</tt> % number of devices defined within the Bluetooth device table</p><p><tt>map.BtDeviceNameCnt</tt> % number of devices defined within the Bluetooth device table (usually equal to BtDeviceCnt)</p><p><tt>map.HsFlags</tt> % High Speed flags</p><p><tt>map.HsSpeed</tt> % High Speed speed</p><p><tt>map.HsState</tt> % High Speed state</p><p><tt>map.HsSpeed</tt> % High Speed speed</p><p><tt>map.UsbState</tt> % USB state</p><h2>Examples<a name="35"></a></h2><pre class="codeinput"> map = MAP_GetCommModule(); 12 </pre><h2>See also<a name="37"></a></h2><p> NXT_ReadIOMap</p><h2>Signature<a name="39"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/23</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>13 </p></div><!--12 </pre><h2>See also<a name="37"></a></h2><p><a href="NXT_ReadIOMap.html">NXT_ReadIOMap</a>, </p><h2>Signature<a name="39"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/23</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 13 Published with wg_publish; V1.0<br></p></div><!-- 14 14 ##### SOURCE BEGIN ##### 15 15 %% MAP_GetCommModule -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MAP_GetInputModule.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MAP_GetInputModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MAP_GetInputModule">9 --><title>MAP_GetInputModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MAP_GetInputModule"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MAP_GetInputModule</h1><!--introduction--><p>Reads the IO map of the input module</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#22">Examples</a></li><li><a href="#25">See also</a></li><li><a href="#27">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>map = MAP_GetInputModule(port)</tt></p><h2>Description<a name="4"></a></h2><p><tt>map = MAP_GetInputModule(port)</tt> returns the IO map of the input module at the given sensor <tt>port</tt>. The sensor <tt>port</tt> can be addressed by <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt>, <tt>SENSOR_4</tt> and <tt>'all'</tt>. The return value <tt>map</tt> is a struct variable or cell array (<tt>'all'</tt> mode). It contains all input module information.</p><p><b>Output:</b></p><p><tt>map.CustomZeroOffset</tt> % custom sensor zero offset value of a sensor.</p><p><tt>map.ADRaw</tt> % raw 10-bit value last read from the ananlog to digital converter. Raw values produced by sensors typically cover some subset of the full 10-bit range.</p><p><tt>map.SensorRaw</tt> % raw sensor value</p><p><tt>map.SensorValue</tt> % tacho/angle limit, 0 means none set</p><p><tt>map.SensorType</tt> % sensor value</p><p><tt>map.SensorMode</tt> % sensor mode</p><p><tt>map.SensorBoolean</tt> % boolean sensor value</p><p><tt>map.DigiPinsDir</tt> % digital pins direction value of a sensor</p><p><tt>map.DigiPinsIn</tt> % digital pins status value of a sensor ?</p><p><tt>map.DigiPinsOut</tt> % digital pins output level value of a sensor</p><p><tt>map.CustomPctFullScale</tt> % custom sensor percent full scale value of the sensor.</p><p><tt>map.CustomActiveStatus</tt> % custom sensor active status value of the sensor</p><p><tt>map.InvalidData</tt> % value of the InvalidData flag of the sensor</p><h2>Examples<a name="22"></a></h2><pre class="codeinput"> map = MAP_GetInputModule(SENSOR_2); 12 12 </pre><pre class="codeinput"> map = MAP_GetInputModule(<span class="string">'all'</span>); 13 </pre><h2>See also<a name="25"></a></h2><p> NXT_ReadIOMap</p><h2>Signature<a name="27"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/23</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="25"></a></h2><p><a href="NXT_ReadIOMap.html">NXT_ReadIOMap</a>, </p><h2>Signature<a name="27"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/23</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% MAP_GetInputModule -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MAP_GetOutputModule.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MAP_GetOutputModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MAP_GetOutputModule">9 --><title>MAP_GetOutputModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MAP_GetOutputModule"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MAP_GetOutputModule</h1><!--introduction--><p>Reads the IO map of the output module</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#27">Examples</a></li><li><a href="#30">See also</a></li><li><a href="#32">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>map = MAP_GetOutputModule(motor)</tt></p><h2>Description<a name="4"></a></h2><p><tt>map = MAP_GetOutputModule(motor)</tt> returns the IO map of the output module at the given <tt>motor</tt> port. The <tt>motor</tt> port can be addressed by <tt>MOTOR_A</tt>, <tt>MOTOR_B</tt>, <tt>MOTOR_C</tt> and <tt>'all'</tt>. The return value <tt>map</tt> is a struct variable or cell array (<tt>'all'</tt> mode). It contains all output module information.</p><p><b>Output:</b></p><p><tt>map.TachoCount</tt> % internal, non-resettable rotation-counter (in degrees)</p><p><tt>map.BlockTachoCount</tt> % block tacho counter, current motor position, resettable using, ResetMotorAngle (NXT-G counter since block start)</p><p><tt>map.RotationCount</tt> % rotation tacho counter, current motor position (NXT-G counter since program start)</p><p><tt>map.TachoLimit</tt> % tacho/angle limit, 0 means none set</p><p><tt>map.MotorRPM</tt> % current pulse width modulation ?</p><p><tt>map.Flags</tt> % should be always ''. Flags are considered in MAP_SetOutputModule.</p><p><tt>map.Mode</tt> % output mode bitfield 1: MOTORON, 2: BRAKE, 4: REGULATED</p><p><tt>map.ModeName</tt> % output mode name interpreted by output mode bitfield</p><p><tt>map.Speed</tt> % motor power/speed</p><p><tt>map.ActualSpeed</tt> % current actual percentage of full power (regulation mode)</p><p><tt>map.RegPParameter</tt> % proportional term of the internal PID control algorithm</p><p><tt>map.RegIParameter</tt> % integral term of the internal PID control algorithm</p><p><tt>map.RegDParameter</tt> % derivate term of the internal PID control algorithm</p><p><tt>map.RunStateByte</tt> % run state byte</p><p><tt>map.RunStateName</tt> % run state name interpreted by run state byte</p><p><tt>map.RegModeByte</tt> % regulation mode byte</p><p><tt>map.RegModeName</tt> % regulation mode name interpreted by regulation mode byte</p><p><tt>map.Overloaded</tt> % overloaded flag (true: speed regulation is unable to onvercome physical load on the motor)</p><p><tt>map.SyncTurnParam</tt> % current turn ratio, 1: 25%, 2:50%, 3:75%, 4:100% of full volume</p><h2>Examples<a name="27"></a></h2><pre class="codeinput"> map = MAP_GetOutputModule(MOTOR_A); 12 12 </pre><pre class="codeinput"> map = MAP_GetOutputModule(<span class="string">'all'</span>); 13 </pre><h2>See also<a name="30"></a></h2><p> NXT_ReadIOMap</p><h2>Signature<a name="32"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="30"></a></h2><p><a href="NXT_ReadIOMap.html">NXT_ReadIOMap</a>, </p><h2>Signature<a name="32"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% MAP_GetOutputModule -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MAP_GetSoundModule.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MAP_GetSoundModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MAP_GetSoundModule">9 --><title>MAP_GetSoundModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MAP_GetSoundModule"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MAP_GetSoundModule</h1><!--introduction--><p>Reads the IO map of the sound module</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#16">Examples</a></li><li><a href="#18">See also</a></li><li><a href="#20">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>map = MAP_GetSoundModule()</tt></p><h2>Description<a name="4"></a></h2><p><tt>map = MAP_GetSoundModule()</tt> returns the IO map of the sound module. The return value <tt>map</tt> is a struct variable. It contains all sound module information.</p><p><b>Output:</b></p><p><tt>map.Frequency</tt> % frequency of the last played ton in Hz</p><p><tt>map.Duration</tt> % duration of the last played ton in ms</p><p><tt>map.SamplingRate</tt> % current sound sample rate</p><p><tt>map.SoundFileName</tt> % sound file name of the last played sound file</p><p><tt>map.Flags</tt> % sound module flag, 'IDLE': sound module is idle, 'UPDATE': a request for plackback is pending, 'RUNNING': playback in progress.</p><p><tt>map.State</tt> % sound module state, 'IDLE'; sound module is idel, 'PLAYING_FILE': sound module is playing a .rso file, 'PLAYING_TONE': a tone is playing, 'STOP': a request to stop playback is in progress.</p><p><tt>map.Mode</tt> % sound module mode, 'ONCE': only play file once , 'LOOP': play file in a loop, 'TONE': play tone.</p><p><tt>map.Volume</tt> % volume: 0: diabled, 1: 25%, 2:50%, 3:75%, 4:100% of full volume</p><h2>Examples<a name="16"></a></h2><pre class="codeinput"> map = MAP_GetSoundModule(); 12 </pre><h2>See also<a name="18"></a></h2><p> NXT_ReadIOMap</p><h2>Signature<a name="20"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>13 </p></div><!--12 </pre><h2>See also<a name="18"></a></h2><p><a href="NXT_ReadIOMap.html">NXT_ReadIOMap</a>, </p><h2>Signature<a name="20"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 13 Published with wg_publish; V1.0<br></p></div><!-- 14 14 ##### SOURCE BEGIN ##### 15 15 %% MAP_GetSoundModule -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MAP_GetUIModule.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MAP_GetUIModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MAP_GetUIModule">9 --><title>MAP_GetUIModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MAP_GetUIModule"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MAP_GetUIModule</h1><!--introduction--><p>Reads the IO map of the user interface module</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#26">Examples</a></li><li><a href="#28">See also</a></li><li><a href="#30">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>map = MAP_GetUIModule()</tt></p><h2>Description<a name="4"></a></h2><p><tt>map = MAP_GetUIModule()</tt> returns the IO map of the user interface module. The return value <tt>map</tt> is a struct variable. It contains all user interface module information.</p><p><b>Output:</b></p><p><tt>map.PMenu</tt> % ?</p><p><tt>map.BatteryVoltage</tt> % battery voltage in mili volt.</p><p><tt>map.LMSfilename</tt> % ?</p><p><tt>map.Flags</tt> % flag bitfield</p><p><tt>map.State</tt> % state value</p><p><tt>map.Button</tt> % button value</p><p><tt>map.RunState</tt> % VM run state</p><p><tt>map.BatteryState</tt> % battery level (0..4)</p><p><tt>map.BluetoothState</tt> % bluetooth state bitfield</p><p><tt>map.UsbState</tt> % USB state</p><p><tt>map.SleepTimout</tt> % sleep timeout value in minutes</p><p><tt>map.SleepTimer</tt> % current sleep timer in minutes</p><p><tt>map.Rechargeable</tt> % true if reachargeable battery is used</p><p><tt>map.Volume</tt> % volume level (0..4)</p><p><tt>map.Error</tt> % error value</p><p><tt>map.OBPPointer</tt> % on brick program pointer</p><p><tt>map.ForceOff</tt> % turn off brick if value is true</p><h2>Examples<a name="26"></a></h2><pre class="codeinput"> map = MAP_GetUIModule(); 12 </pre><h2>See also<a name="28"></a></h2><p> NXT_ReadIOMap</p><h2>Signature<a name="30"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/23</li><li><b>Copyright:</b> 2007- 2008, RWTH Aachen University</li></ul></div><p class="footer"><br>13 </p></div><!--12 </pre><h2>See also<a name="28"></a></h2><p><a href="NXT_ReadIOMap.html">NXT_ReadIOMap</a>, </p><h2>Signature<a name="30"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/23</li><li><b>Copyright:</b> 2007- 2008, RWTH Aachen University</li></ul></div><p class="footer"><br> 13 Published with wg_publish; V1.0<br></p></div><!-- 14 14 ##### SOURCE BEGIN ##### 15 15 %% MAP_GetUIModule -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MAP_SetOutputModule.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MAP_SetOutputModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MAP_SetOutputModule">9 --><title>MAP_SetOutputModule</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MAP_SetOutputModule"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MAP_SetOutputModule</h1><!--introduction--><p>Writes the IO map to the output module</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#26">Examples</a></li><li><a href="#29">See also</a></li><li><a href="#31">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>MAP_SetOutputModule(motor, map)</tt></p><p><tt>MAP_SetOutputModule(motor, map, varargin)</tt></p><h2>Description<a name="5"></a></h2><p><tt>map = MAP_SetOutputModule(motor, map)</tt> writes the IO <tt>map</tt> to the output module at the given motor <tt>motor</tt>. The <tt>motor</tt> port can be addressed by <tt>MOTOR_A</tt>, <tt>MOTOR_B</tt>, <tt>MOTOR_C</tt>. The <tt>map</tt> structure has to provide all output module information, listed below.</p><p><b>Input:</b></p><p><tt>map.TachoCount</tt> % internal, non-resettable rotation-counter (in degrees)</p><p><tt>map.BlockTachoCount</tt> % block tacho counter, current motor position, resettable using, ResetMotorAngle (NXT-G counter since block start)</p><p><tt>map.RotationCount</tt> % rotation tacho counter, current motor position (NXT-G counter since program start)</p><p><tt>map.TachoLimit</tt> % current set tacho/angle limit, 0 means none set</p><p><tt>map.MotorRPM</tt> % current pulse width modulation ?</p><p><tt>map.Flags</tt> % update flag bitfield, commits any changing (see also varargin)</p><p><tt>map.Mode</tt> % output mode bitfield 1: MOTORON, 2: BRAKE, 4: REGULATED</p><p><tt>map.Speed</tt> % current motor power/speed</p><p><tt>map.ActualSpeed</tt> % current actual percentage of full power (regulation mode)</p><p><tt>map.RegPParameter</tt> % proportional term of the internal PID control algorithm</p><p><tt>map.RegIParameter</tt> % integral term of the internal PID control algorithm</p><p><tt>map.RegDParameter</tt> % derivate term of the internal PID control algorithm</p><p><tt>map.RunStateByte</tt> % run state byte</p><p><tt>map.RegModeByte</tt> % regulation mode byte</p><p><tt>map.Overloaded</tt> % overloaded flag (true: speed regulation is unable to onvercome physical load on the motor)</p><p><tt>map.SyncTurnParam</tt> % current turn ratio, 1: 25%, 2:50%, 3:75%, 4:100% of full volume</p><p>map = MAP_SetOutputModule(motor, map, varargin) sets the update flags explicit by the given arguments. 'UpdateMode': commits changes to the mode property 'UpdateSpeed': commits changes to the speed property 'UpdateTachoLimit': commits changes to the tacho limit property 'ResetCounter': resets internal movement counters, cancels current goal, and resets internal error-correction system 'UpdatePID': commits changes to PID regulation parameters 'ResetBlockTachoCount': resets block tacho count (block-relative position counter (NXT-G)) 'ResetRotationCount': resets rotation count (program-relative position counter (NXT-G))</p><h2>Examples<a name="26"></a></h2><pre class="codeinput"> MAP_SetOutputModule(MOTOR_A, map); … … 13 13 map.RegPParameter = 20; 14 14 MAP_SetOutputModule(MOTOR_A, map, <span class="string">'UpdatePID'</span>); 15 </pre><h2>See also<a name="29"></a></h2><p> MAP_GetOutputModule, NXT_WriteIOMap</p><h2>Signature<a name="31"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="29"></a></h2><p><a href="MAP_GetOutputModule.html">MAP_GetOutputModule</a>, <a href="NXT_WriteIOMap.html">NXT_WriteIOMap</a>, </p><h2>Signature<a name="31"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% MAP_SetOutputModule -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MOTOR_A.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MOTOR_A</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MOTOR_A">9 --><title>MOTOR_A</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MOTOR_A"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MOTOR_A</h1><!--introduction--><p>Symbolic constant MOTOR_A (returns 0)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>portA = MOTOR_A()</tt></p><h2>Description<a name="4"></a></h2><p><tt>portA = MOTOR_A()</tt> returns <tt>0</tt> as the value <tt>portA</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> portA = MOTOR_A() 12 12 <span class="comment">%result: >> portA = 0</span> 13 </pre><h2>See also<a name="8"></a></h2><p> MOTOR_B, MOTOR_C</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="MOTOR_B.html">MOTOR_B</a>, <a href="MOTOR_C.html">MOTOR_C</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% MOTOR_A -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MOTOR_B.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MOTOR_B</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MOTOR_B">9 --><title>MOTOR_B</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MOTOR_B"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MOTOR_B</h1><!--introduction--><p>Symbolic constant MOTOR_B (returns 1)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>portB = MOTOR_B()</tt></p><h2>Description<a name="4"></a></h2><p><tt>portB = MOTOR_B()</tt> returns <tt>1</tt> as the value <tt>portB</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> portB = MOTOR_B() 12 12 <span class="comment">%result: >> portB = 1</span> 13 </pre><h2>See also<a name="8"></a></h2><p> MOTOR_A, MOTOR_C</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_C.html">MOTOR_C</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% MOTOR_B -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/MOTOR_C.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>MOTOR_C</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_MOTOR_C">9 --><title>MOTOR_C</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_MOTOR_C"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>MOTOR_C</h1><!--introduction--><p>Symbolic constant MOTOR_C (returns 2)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>portC = MOTOR_C()</tt></p><h2>Description<a name="4"></a></h2><p><tt>portC = MOTOR_C()</tt> returns <tt>2</tt> as the value <tt>portC</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> portC = MOTOR_C() 12 12 <span class="comment">%result: >> portC = 2</span> 13 </pre><h2>See also<a name="8"></a></h2><p> MOTOR_A, MOTOR_B</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_B.html">MOTOR_B</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% MOTOR_C -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXC_GetSensorMotorData.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXC_GetSensorMotorData</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXC_GetSensorMotorData">9 --><title>NXC_GetSensorMotorData</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXC_GetSensorMotorData"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 </head><body><div class="content"><h1>NXC_GetSensorMotorData</h1><!--introduction--><p> Retrieves selected data from all analog sensors and all motors in a single packet</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#7">Limitations</a></li><li><a href="#10">Example</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[sensorData motorData] = NXC_GetSensorMotorData(handle)</tt></p><h2>Description<a name="5"></a></h2><p>This function uses the embedded NXC program MotorControl to retrieve certain data from all analog sensors and all motors connected to the NXT. The sensors must already be opened. The function does no interprete any data for you. The big advantage of this function is that it retrieves all the data within one single Bluetooth / USB packet, which is faster than retrieving all information one by one after each other...</p><h2>Limitations<a name="7"></a></h2><p>This function is not yet implemented and does not return any data!</p><h2>Example<a name="10"></a></h2><h2>See also<a name="13"></a></h2><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>12 </p></div><!--11 </head><body><div class="content"><h1>NXC_GetSensorMotorData</h1><!--introduction--><p><a href="Retrieves selected data from all analog sensors and all motors in a single packet.html">Retrieves selected data from all analog sensors and all motors in a single packet</a>, </p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#7">Limitations</a></li><li><a href="#10">Example</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[sensorData motorData] = NXC_GetSensorMotorData(handle)</tt></p><h2>Description<a name="5"></a></h2><p>This function uses the embedded NXC program MotorControl to retrieve certain data from all analog sensors and all motors connected to the NXT. The sensors must already be opened. The function does no interprete any data for you. The big advantage of this function is that it retrieves all the data within one single Bluetooth / USB packet, which is faster than retrieving all information one by one after each other...</p><h2>Limitations<a name="7"></a></h2><p>This function is not yet implemented and does not return any data!</p><h2>Example<a name="10"></a></h2><h2>See also<a name="13"></a></h2><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 12 Published with wg_publish; V1.0<br></p></div><!-- 13 13 ##### SOURCE BEGIN ##### 14 14 %% NXC_GetSensorMotorData -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXC_MotorControl.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXC_MotorControl</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXC_MotorControl">9 --><title>NXC_MotorControl</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXC_MotorControl"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 </head><body><div class="content"><h1>NXC_MotorControl</h1><!--introduction--><p> Sends advanced motor-command to the NXC-program MotorControl on the NXT brick</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#26">Limitations</a></li><li><a href="#32">Example</a></li><li><a href="#35">See also</a></li><li><a href="#37">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXC_MotorControl(Port, Power, TachoLimit, SpeedRegulation, ActionAtTachoLimit, SmoothStart)</tt></p><p><tt>NXC_MotorControl(Port, Power, TachoLimit, SpeedRegulation, ActionAtTachoLimit, SmoothStart, handle)</tt></p><h2>Description<a name="5"></a></h2><p>The NXC-program "MotorControl" must be running on the brick, otherwise this function will not work. It is used to send advanced motor commands to the NXT that can perform better and more precise motor regulation than possible with only classic direct commands.</p><p>While one command is being executed (i.e. when the motor is still being controlled if a <tt>TachoLimit</tt> other than 0 was set), this motor cannot accept new commands. Use the NXTMotor classes command <tt>.WaitFor</tt> to make sure the motor has finished it's current operation, before sending a new one. If the NXC-program receives a new command while it is still busy, a warning signal (high beep, then low beep) will be played.</p><p>The command <tt>StopMotor</tt> (or NXTMotor's method <tt>.Stop</tt>) is always available to stop a controlled motor-operation, even before the <tt>TachoLimit</tt> is reached.</p><p><b>Input:</b></p><div><ul><li><tt>Port</tt> has to be a port number between 0 and 2, or an array with max. 2 different motors specified.</li></ul></div><div><ul><li><tt>Power</tt> is the power level applied to the motor, value between -100 and 100 (sign changes direction)</li></ul></div><div><ul><li><tt>TachoLimit</tt> - integer from 0 to 99999, specifies the angle in degrees the motor will try to reach, set 0 to run forever. Note that direction is specified by the sign of <tt>Power</tt>.</li></ul></div><div><ul><li><tt>SpeedRegulation</tt> must be <tt>false</tt> for "normal", unregulated motor control. If set to <tt>true</tt>, single motors will be operated in speed regulation mode. This means that the motor will increase its internal power setting to reach a constant turning speed. Use this option when working with motors under varying load. If you'd like to have motor movement with preferrably constant torque, it's advisable to disable this option. In conjunction with multiple motors (i.e. when <tt>Port</tt> is an array of 2 ports), you have to disable <tt>SpeedRegulation</tt>! Multiple motorss will enable synchronization between the two motors. They will run at the same speed as if they were connected through and axle, leading to straight movement for driving bots.</li></ul></div><div><ul><li><tt>ActionAtTachoLimit</tt> is a string parameter with valid options <tt>'Coast'</tt>, <tt>'Brake'</tt> or <tt>'HoldBrake'</tt>. It specifies how the motor(s) should react when their position counter reaches the set <tt>TachoLimit</tt>. In COAST mode, the motor(s) will simply be turned of when the <tt>TachoLimit</tt> is reached, leading to free movement until slowly stopping (called coasting). The <tt>TachoLimit</tt> won't be met, the motor(s) move way too far (overshooting), depending on their angular momentum. Use BRAKE mode (default) to let the motor(s) automatically slow down nice and smoothly shortly before the <tt>TachoLimit</tt>. This leads to a very high precision, usually the <tt>TachoLimit</tt> is met within +/- 1 degree (depending on the motor load and speed of course). After this braking, power to the motor(s) is turned off when they are at rest. HOLDBRAKE is similar to BRAKE, but in this case, the active brake of the motors stays enabled (careful, this consumes a lot of battery power), causing the motor(s) to actively keep holding their position.</li></ul></div><div><ul><li><tt>SmoothStart</tt> can be set to <tt>true</tt> to smoothly accelerate movement. This "manual ramp up" of power will occur fairly quickly. It's comfortable for driving robots so that they don't loose traction when starting to move. If used in conjunction with <tt>SpeedRegulation</tt> for single motors, after accleration is finished and the full power is applied, the speed regulation can possibly even accelerate a bit more.</li></ul></div><div><ul><li><tt>handle</tt> (optional) defines the given NXT connection. If no handle is specified, the default one (<tt>COM_GetDefaultNXT()</tt>) is used.</li></ul></div><h2>Limitations<a name="26"></a></h2><p>If you send a command to the NXT without waiting for the previous motor operation to have finished, the command will be dropped (the NXT indicates this with a high and low beep tone). Use NXTMotor classes <tt>WaitFor</tt> to make sure the motor is ready for new commands, or stop the motor using NXTMotor's method <tt>.Stop</tt>.</p><p>The option <tt>SmoothStart</tt> in conjunction with <tt>ActionAtTachoLimit == 'Coast'</tt> is not available. As a workaround, disable <tt>SmoothStart</tt> for this mode.</p><p>With ActionAtTachoLimit = 'Coast' and synchronous driving (two motors), the motors will stay synced after movement (even after <tt>.WaitFor()</tt> has finished). This is by design. To disable the synchonization, just use <tt>StopMotor(port, 'off')</tt>.</p><h2>Example<a name="32"></a></h2><h2>See also<a name="35"></a></h2><p>WaitForMotor, NXT_SetOutputState, NXT_GetOutputState, NXC_ResetErrorCorrection, MOTOR_A, MOTOR_B, MOTOR_C</p><h2>Signature<a name="37"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>12 </p></div><!--11 </head><body><div class="content"><h1>NXC_MotorControl</h1><!--introduction--><p><a href="Sends advanced motor-command to the NXC-program MotorControl on the NXT brick.html">Sends advanced motor-command to the NXC-program MotorControl on the NXT brick</a>, </p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#26">Limitations</a></li><li><a href="#32">Example</a></li><li><a href="#35">See also</a></li><li><a href="#37">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXC_MotorControl(Port, Power, TachoLimit, SpeedRegulation, ActionAtTachoLimit, SmoothStart)</tt></p><p><tt>NXC_MotorControl(Port, Power, TachoLimit, SpeedRegulation, ActionAtTachoLimit, SmoothStart, handle)</tt></p><h2>Description<a name="5"></a></h2><p>The NXC-program "MotorControl" must be running on the brick, otherwise this function will not work. It is used to send advanced motor commands to the NXT that can perform better and more precise motor regulation than possible with only classic direct commands.</p><p>While one command is being executed (i.e. when the motor is still being controlled if a <tt>TachoLimit</tt> other than 0 was set), this motor cannot accept new commands. Use the NXTMotor classes command <tt>.WaitFor</tt> to make sure the motor has finished it's current operation, before sending a new one. If the NXC-program receives a new command while it is still busy, a warning signal (high beep, then low beep) will be played.</p><p>The command <tt>StopMotor</tt> (or NXTMotor's method <tt>.Stop</tt>) is always available to stop a controlled motor-operation, even before the <tt>TachoLimit</tt> is reached.</p><p><b>Input:</b></p><div><ul><li><tt>Port</tt> has to be a port number between 0 and 2, or an array with max. 2 different motors specified.</li></ul></div><div><ul><li><tt>Power</tt> is the power level applied to the motor, value between -100 and 100 (sign changes direction)</li></ul></div><div><ul><li><tt>TachoLimit</tt> - integer from 0 to 99999, specifies the angle in degrees the motor will try to reach, set 0 to run forever. Note that direction is specified by the sign of <tt>Power</tt>.</li></ul></div><div><ul><li><tt>SpeedRegulation</tt> must be <tt>false</tt> for "normal", unregulated motor control. If set to <tt>true</tt>, single motors will be operated in speed regulation mode. This means that the motor will increase its internal power setting to reach a constant turning speed. Use this option when working with motors under varying load. If you'd like to have motor movement with preferrably constant torque, it's advisable to disable this option. In conjunction with multiple motors (i.e. when <tt>Port</tt> is an array of 2 ports), you have to disable <tt>SpeedRegulation</tt>! Multiple motorss will enable synchronization between the two motors. They will run at the same speed as if they were connected through and axle, leading to straight movement for driving bots.</li></ul></div><div><ul><li><tt>ActionAtTachoLimit</tt> is a string parameter with valid options <tt>'Coast'</tt>, <tt>'Brake'</tt> or <tt>'HoldBrake'</tt>. It specifies how the motor(s) should react when their position counter reaches the set <tt>TachoLimit</tt>. In COAST mode, the motor(s) will simply be turned of when the <tt>TachoLimit</tt> is reached, leading to free movement until slowly stopping (called coasting). The <tt>TachoLimit</tt> won't be met, the motor(s) move way too far (overshooting), depending on their angular momentum. Use BRAKE mode (default) to let the motor(s) automatically slow down nice and smoothly shortly before the <tt>TachoLimit</tt>. This leads to a very high precision, usually the <tt>TachoLimit</tt> is met within +/- 1 degree (depending on the motor load and speed of course). After this braking, power to the motor(s) is turned off when they are at rest. HOLDBRAKE is similar to BRAKE, but in this case, the active brake of the motors stays enabled (careful, this consumes a lot of battery power), causing the motor(s) to actively keep holding their position.</li></ul></div><div><ul><li><tt>SmoothStart</tt> can be set to <tt>true</tt> to smoothly accelerate movement. This "manual ramp up" of power will occur fairly quickly. It's comfortable for driving robots so that they don't loose traction when starting to move. If used in conjunction with <tt>SpeedRegulation</tt> for single motors, after accleration is finished and the full power is applied, the speed regulation can possibly even accelerate a bit more.</li></ul></div><div><ul><li><tt>handle</tt> (optional) defines the given NXT connection. If no handle is specified, the default one (<tt>COM_GetDefaultNXT()</tt>) is used.</li></ul></div><h2>Limitations<a name="26"></a></h2><p>If you send a command to the NXT without waiting for the previous motor operation to have finished, the command will be dropped (the NXT indicates this with a high and low beep tone). Use NXTMotor classes <tt>WaitFor</tt> to make sure the motor is ready for new commands, or stop the motor using NXTMotor's method <tt>.Stop</tt>.</p><p>The option <tt>SmoothStart</tt> in conjunction with <tt>ActionAtTachoLimit == 'Coast'</tt> is not available. As a workaround, disable <tt>SmoothStart</tt> for this mode.</p><p>With ActionAtTachoLimit = 'Coast' and synchronous driving (two motors), the motors will stay synced after movement (even after <tt>.WaitFor()</tt> has finished). This is by design. To disable the synchonization, just use <tt>StopMotor(port, 'off')</tt>.</p><h2>Example<a name="32"></a></h2><h2>See also<a name="35"></a></h2><p>WaitForMotor, NXT_SetOutputState, NXT_GetOutputState, NXC_ResetErrorCorrection, MOTOR_A, MOTOR_B, MOTOR_C</p><h2>Signature<a name="37"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 12 Published with wg_publish; V1.0<br></p></div><!-- 13 13 ##### SOURCE BEGIN ##### 14 14 %% NXC_MotorControl -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXC_ResetErrorCorrection.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXC_ResetErrorCorrection</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXC_ResetErrorCorrection">9 --><title>NXC_ResetErrorCorrection</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXC_ResetErrorCorrection"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXC_ResetErrorCorrection</h1><!--introduction--><p>Sends reset error correction command to the NXC-program MotorControl on the NXT</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#15">Limitations</a></li><li><a href="#18">Example</a></li><li><a href="#21">See also</a></li><li><a href="#24">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXC_ResetErrorCorrection(port)</tt></p><p><tt>NXC_ResetErrorCorrection(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p>The NXC-program "MotorControl" must be running on the brick, otherwise this function will not work. It is used to sent advanced motor commands to the NXT that can perform better and more precise motor regulation than possible with only classic direct commands.</p><p>This function resets the "internal error correction memory" for the according motor. Usually, you cannot move the NXT motors by hand in between two commands that control the motors, since the modified motor position does not match the internal counters any more. This leads to unexpected motor behaviour (when the NXT firmware tries to correct the manual movements you just made).</p><p>To work around this problem, it is possible to reset the error correction counter by hand using this function. It will clear the counter <tt>TachoCount</tt>, since this counter is internally attached to the error correction. The counter <tt>BlockTachoCount</tt> (see direct commands specification of the LEGO Mindstorms Bluetooth Developer Kit) will also be reset (since it is used to coordinate multiple motors during synchronous driving).</p><p>It is recommended to call this function before using classic direct commands (i.e. like <tt>NXT_SetOutputState</tt>), to get the intuitively expected results.</p><p><b>Input:</b></p><p><tt>port</tt> has to be a port number between 0 and 2. It can also be an array of valid port-numbers, i.e. <tt>[0; 1]</tt>, <tt>[0; 2]</tt>, <tt>[1; 2]</tt> or <tt>[0; 1; 2]</tt>. The named constants <tt>MOTOR_A</tt> to <tt>MOTOR_C</tt> can be used for clarity (i.e. <tt>port = [MOTOR_A; MOTOR_B]</tt>.</p><p><tt>handle</tt> is optional and determines the NXT handle to be used, if specified. Otherwise the default handle will be used (set using <tt>COM_SetDefaultNXT</tt>).</p><h2>Limitations<a name="15"></a></h2><p>This function has a built-in waiting-period. A pause of 75ms will be made after sending the actual command to the NXT.</p><h2>Example<a name="18"></a></h2><pre class="codeinput"> <span class="comment">% This will reset the TachoCount counter for port A on the NXT, which</span> … … 17 17 <span class="comment">% -- it will stay untouched until reset by a motor object's method</span> 18 18 <span class="comment">% |ResetPosition()|)</span> 19 </pre><h2>See also<a name="21"></a></h2><p> NXTMotor, NXC_MotorControl, NXT_SetOutputState, NXT_GetOutputState, NXT_ResetMotorPosition, ReadFromNXT</p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/11/12</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>20 </p></div><!--19 </pre><h2>See also<a name="21"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="NXC_MotorControl.html">NXC_MotorControl</a>, <a href="NXT_SetOutputState.html">NXT_SetOutputState</a>, <a href="NXT_GetOutputState.html">NXT_GetOutputState</a>, <a href="NXT_ResetMotorPosition.html">NXT_ResetMotorPosition</a>, <a href="ReadFromNXT.html">ReadFromNXT</a>, </p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/11/12</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 20 Published with wg_publish; V1.0<br></p></div><!-- 21 21 ##### SOURCE BEGIN ##### 22 22 %% NXC_ResetErrorCorrection -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXTMotor.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXTMotor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXTMotor">9 --><title>NXTMotor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXTMotor"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXTMotor</h1><!--introduction--><p>Constructs an NXTMotor object</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#6">Description</a></li><li><a href="#27">Limitations</a></li><li><a href="#34">Example:</a></li><li><a href="#39">See also</a></li><li><a href="#42">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>M = NXTMotor()</tt></p><p><tt>M = NXTMotor(PORT)</tt></p><p><tt>M = NXTMotor(PORT, 'PropName1', PropValue1, 'PropName2', PropValue2, ...)</tt></p><h2>Description<a name="6"></a></h2><p><tt>M = NXTMotor(PORT)</tt> constructs an NXTMotor object with motor port <tt>PORT</tt> and default attributes. <tt>PORT</tt> may be either the port number (0, 1, 2 or <tt>MOTOR_A</tt>, <tt>MOTOR_B</tt>, <tt>MOTOR_C</tt>) or a string specifying the port ('A', 'B', 'C'). To have two motors synchronized <tt>PORT</tt> may be a vector of two ports in ascending order.</p><p><tt>M = NXTMotor(PORT, 'PropName1', PropValue1, 'PropName2', PropValue2, ...)</tt> constructs an NXTMotor object with motor port(s) <tt>PORT</tt> in which the given Property name/value pairs are set on the object. All properties can also be set after creation by dot-notation (see example).</p><p>Available properties are:</p><div><ul><li><tt>Port</tt> - the motor port(s) being used, either a string composed of the letters <tt>'A'</tt>, <tt>'B'</tt>, <tt>'C'</tt>, or a single value or array of the numbers 0, 1, 2. A maximum of 2 motors is allowed. If 2 motors are specified, the bot will drive in sync mode, good for driving straight ahead.</li></ul></div><div><ul><li><tt>Power</tt> - integer from -100 to 100, sets power level and direction of rotation (0 to 100%)</li></ul></div><div><ul><li><tt>SpeedRegulation</tt> - if set to <tt>true</tt> (default), the motor will try to hold a constant speed by adjusting power output according to load (e.g. friction) - this is only valid for single motors. It must be deactivated when using two motors! If you'd like to have motor movement with preferrably constant torque, it's advisable to disable this option. <tt>SpeedRegulation</tt> must be <tt>false</tt> for "normal", unregulated motor control. If set to <tt>true</tt>, single motors will be operated in speed regulation mode. This means that the motor will increase its internal power setting to reach a constant turning speed. Use this option when working with motors under varying load. If you'd like to have motor movement with preferrably constant torque, it's advisable to disable this option. In conjunction with multiple motors (i.e. when <tt>Port</tt> is an array of 2 ports), you have to disable <tt>SpeedRegulation</tt>! Multiple motors will enable synchronization between the two motors. They will run at the same speed as if they were connected through and axle, leading to straight movement for driving bots.</li></ul></div><div><ul><li><tt>TachoLimit</tt> - integer from 0 to 99999, specifies the angle in degrees the motor will try to reach, set 0 to run forever. Note that direction is specified by the sign of <tt>Power</tt>.</li></ul></div><p> … … 75 75 76 76 NXT_PlayTone(500, 100); <span class="comment">% all done</span> 77 </pre><h2>See also<a name="39"></a></h2><p> SendToNXT, ReadFromNXT, WaitFor, Stop, ResetPosition, DirectMotorCommand</p><h2>Signature<a name="42"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Aulis Telle, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/08/24</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>78 </p></div><!--77 </pre><h2>See also<a name="39"></a></h2><p><a href="SendToNXT.html">SendToNXT</a>, <a href="ReadFromNXT.html">ReadFromNXT</a>, <a href="WaitFor.html">WaitFor</a>, <a href="Stop.html">Stop</a>, <a href="ResetPosition.html">ResetPosition</a>, <a href="DirectMotorCommand.html">DirectMotorCommand</a>, </p><h2>Signature<a name="42"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Aulis Telle, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/08/24</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 78 Published with wg_publish; V1.0<br></p></div><!-- 79 79 ##### SOURCE BEGIN ##### 80 80 %% NXTMotor -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_GetBatteryLevel.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_GetBatteryLevel</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_GetBatteryLevel">9 --><title>NXT_GetBatteryLevel</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_GetBatteryLevel"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_GetBatteryLevel</h1><!--introduction--><p>Returns the current battery level in milli volts</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Examples</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>voltage = NXT_GetBatteryLevel()</tt></p><p><tt>voltage = NXT_GetBatteryLevel(handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>voltage = NXT_GetBatteryLevel()</tt> returns the current battery level <tt>voltage</tt> of the NXT Brick in milli voltage.</p><p><tt>voltage = NXT_GetBatteryLevel(handle)</tt> uses the given Bluetooth connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system.</p><p>If no Bluetooth handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><h2>Examples<a name="9"></a></h2><pre class="codeinput"> voltage = NXT_GetBatteryLevel(); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 voltage = NXT_GetBatteryLevel(handle); 14 </pre><h2>See also<a name="12"></a></h2><p> COM_GetDefaultNXT, NXT_SendKeepAlive</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="12"></a></h2><p><a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, <a href="NXT_SendKeepAlive.html">NXT_SendKeepAlive</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_GetBatteryLevel -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_GetCurrentProgramName.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_GetCurrentProgramName</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_GetCurrentProgramName">9 --><title>NXT_GetCurrentProgramName</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_GetCurrentProgramName"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_GetCurrentProgramName</h1><!--introduction--><p>Returns the name of the current running program</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Examples</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[name prog_run] = NXT_GetCurrentProgramName()</tt></p><p><tt>[name prog_run] = NXT_GetCurrentProgramName(handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>[name prog_run] = NXT_GetCurrentProgramName()</tt> returns the <tt>name</tt> of the current running program. and the boolean flag <tt>prog_run</tt> (false == no program is running).</p><p><tt>[name prog_run] = NXT_GetCurrentProgramName(handle)</tt> uses the given NXT <tt>handle</tt>.</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><h2>Examples<a name="9"></a></h2><pre class="codeinput"> name = NXT_GetCurrentProgramName(); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 name = NXT_GetCurrentProgramName(handle); 14 </pre><h2>See also<a name="12"></a></h2><p> NXT_StartProgram, NXT_StopProgram</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/10/18</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="12"></a></h2><p><a href="NXT_StartProgram.html">NXT_StartProgram</a>, <a href="NXT_StopProgram.html">NXT_StopProgram</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/10/18</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_GetCurrentProgramName -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_GetFirmwareVersion.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_GetFirmwareVersion</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_GetFirmwareVersion">9 --><title>NXT_GetFirmwareVersion</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_GetFirmwareVersion"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_GetFirmwareVersion</h1><!--introduction--><p>Returns the protocol and firmware version of the NXT</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Examples</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[protocol_version firmware_version] = NXT_GetFirmwareVersion()</tt></p><p><tt>[protocol_version firmware_version] = NXT_GetFirmwareVersion(handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>[protocol_version firmware_version] = NXT_GetFirmwareVersion()</tt> returns the protocol and firmware version of the NXT as strings.</p><p><tt>[protocol_version firmware_version] = NXT_GetFirmwareVersion(handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no NXT <tt>handle</tt> is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><h2>Examples<a name="9"></a></h2><pre class="codeinput"> [protocol_version firmware_version] = NXT_GetFirmwareVersion(); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 [protocol_version firmware_version] = NXT_GetFirmwareVersion(handle); 14 </pre><h2>See also<a name="12"></a></h2><p> COM_GetDefaultNXT</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="12"></a></h2><p><a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_GetFirmwareVersion -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_GetInputValues.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_GetInputValues</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_GetInputValues">9 --><title>NXT_GetInputValues</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_GetInputValues"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_GetInputValues</h1><!--introduction--><p>Executes a complete sensor reading (requests and retrieves input values)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#26">Examples</a></li><li><a href="#29">See also</a></li><li><a href="#31">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>data = NXT_GetInputValues(port)</tt></p><p><tt>data = NXT_GetInputValues(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>data = NXT_GetInputValues(port)</tt> processes a complete sensor reading, i.e. requests input values and collects the answer of the given sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The return value <tt>data</tt> is a struct variable. It contains several sensor settings and information.</p><p><tt>data = NXT_GetInputValues(port, handle)</tt> uses the given Bluetooth connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system.</p><p>If no Bluetooth handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p><b>Output:</b></p><p><tt>data.Port</tt> % current port number (<tt>0..3</tt>)</p><p><tt>data.Valid</tt> % validation flag</p><p><tt>data.Calibrated</tt> % boolean, <tt>true</tt> if calibration file found and used</p><p><tt>data.TypeByte</tt> % sensor type</p><p><tt>data.TypeName</tt> % sensor mode</p><p><tt>data.ModeByte</tt> % mode</p><p><tt>data.ModeName</tt> % mode name</p><p><tt>data.RawADVal</tt> % raw A/D value</p><p><tt>data.NormalizedADVal</tt> % normalized A/D value</p><p><tt>data.ScaledVal</tt> % scaled value</p><p><tt>data.CalibratedVal</tt> % calibrated value</p><p><b>Note:</b></p><p>Data are only valid if <tt>.Valid</tt> is ~= 0. This should usually be the case, but a short while after setting a new sensor mode using <tt>NXT_SetInputMode</tt>, you have to carefully check .Valid on your own! Experience shows that only <tt>.ScaledVal</tt> is influenced by this, apparently <tt>.NormalizedADVal</tt> seems valid all the time, but closer examination is needed...</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="26"></a></h2><pre class="codeinput"> data = NXT_GetInputValues(SENSOR_3); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 data = NXT_GetInputValues(SENSOR_1, handle); 14 </pre><h2>See also<a name="29"></a></h2><p> NXT_SetInputMode, GetLight, GetSwitch, GetSound, GetUltrasonic, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="31"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="29"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="GetLight.html">GetLight</a>, <a href="GetSwitch.html">GetSwitch</a>, <a href="GetSound.html">GetSound</a>, <a href="GetUltrasonic.html">GetUltrasonic</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="31"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_GetInputValues -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_GetOutputState.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_GetOutputState</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_GetOutputState">9 --><title>NXT_GetOutputState</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_GetOutputState"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_GetOutputState</h1><!--introduction--><p>Requests and retrieves an output motor state reading</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#27">Examples</a></li><li><a href="#30">See also</a></li><li><a href="#32">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>data = NXT_GetOutputState(port)</tt></p><p><tt>data = NXT_GetOutputState(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>data = NXT_GetOutputState(port)</tt> requests and retrieves an output motor state reading of the given motor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>MOTOR_A</tt>, <tt>MOTOR_B</tt> and <tt>MOTOR_C</tt> analog to the labeling on the NXT Brick. The return value <tt>data</tt> is a struct variable. It contains several motor settings and information.</p><p><tt>data = NXT_GetOutputState(port, handle)</tt> uses the given Bluetooth connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system.</p><p>If no Bluetooth handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p><b>Output:</b></p><p><tt>data.Port</tt> % current port number (<tt>0..3</tt>)</p><p><tt>data.Power</tt> % current motor power</p><p><tt>data.Mode</tt> % motor mode byte</p><p><tt>data.ModeIsMOTORON</tt> % flag: "motor is on"</p><p><tt>data.ModeIsBRAKE</tt> % flag: "motor uses the advanced brake mode (PVM)"</p><p><tt>data.ModeIsREGULATED</tt> % flag: "motor uses a regulation"</p><p><tt>data.RegModeByte</tt> % motor regulation byte</p><p><tt>data.RegModeName</tt> % name of regulation mode</p><p><tt>data.TurnRatio</tt> % turn ratio value</p><p><tt>data.RunStateByte</tt> % motor run state byte</p><p><tt>data.RunStateName</tt> % name of run state</p><p><tt>data.TachoLimit</tt> % tacho / angle limit</p><p><tt>data.TachoCount</tt> % current absolute tacho count</p><p><tt>data.BlockTachoCount</tt> % current relative tacho count</p><p><tt>data.RotationCount</tt> % current second relative tacho count</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="27"></a></h2><pre class="codeinput"> data = NXT_GetOutputState(MOTOR_B); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 data = NXT_GetOutputState(MOTOR_A, handle); 14 </pre><h2>See also<a name="30"></a></h2><p> ReadFromNXT, NXT_SetOutputState, DirectMotorCommand, MOTOR_A, MOTOR_B, MOTOR_C</p><h2>Signature<a name="32"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="30"></a></h2><p><a href="ReadFromNXT.html">ReadFromNXT</a>, <a href="NXT_SetOutputState.html">NXT_SetOutputState</a>, <a href="DirectMotorCommand.html">DirectMotorCommand</a>, <a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_B.html">MOTOR_B</a>, <a href="MOTOR_C.html">MOTOR_C</a>, </p><h2>Signature<a name="32"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_GetOutputState -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_LSGetStatus.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_LSGetStatus</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_LSGetStatus">9 --><title>NXT_LSGetStatus</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_LSGetStatus"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_LSGetStatus</h1><!--introduction--><p>Gets the number of available bytes for digital low speed sensors (I2C)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#15">Examples</a></li><li><a href="#18">See also</a></li><li><a href="#21">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[BytesReady status] = NXT_LSGetStatus(port)</tt></p><p><tt>[BytesReady status] = NXT_LSGetStatus(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>[BytesReady status] = NXT_LSGetStatus(port)</tt> gets the number of available bytes from the low speed (digital) sensor reading of the given sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The return value <tt>BytesReady</tt> contains the number of bytes available to read. <tt>status</tt> indicates if an error occures by the packet transmission. Function <tt>checkStatusBytes</tt> is interpreting this information per default.</p><p><tt>[BytesReady status] = NXT_LSGetStatus(port, handle)</tt> uses the given Bluetooth connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system.</p><p>If no Bluetooth handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><p><b>Note:</b></p><p>This function's status byte sometimes contains an error message: "Pending communication transaction in progress". This is by design (see documentation of NXTCommLSCheckStatus on page 70 of the "LEGO Mindstorms NXT Executable File Specification" document).</p><p>Before using LS commands, the sensor mode has to be set to <tt>LOWSPEED_9V</tt> using the NXT_SetInputMode command.</p><h2>Examples<a name="15"></a></h2><pre class="codeinput"> [BytesReady status] = NXT_LSGetStatus(SENSOR_3); … … 14 14 <span class="comment">% note that status can contain errorsmessages, use checkStatusByte</span> 15 15 [BytesReady status] = NXT_LSGetStatus(SENSOR_1, handle); 16 </pre><h2>See also<a name="18"></a></h2><p> NXT_SetInputMode, checkStatusByte, NXT_LSWrite, NXT_LSRead</p><h2>Signature<a name="21"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>17 </p></div><!--16 </pre><h2>See also<a name="18"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="checkStatusByte.html">checkStatusByte</a>, <a href="NXT_LSWrite.html">NXT_LSWrite</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, </p><h2>Signature<a name="21"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 17 Published with wg_publish; V1.0<br></p></div><!-- 18 18 ##### SOURCE BEGIN ##### 19 19 %% NXT_LSGetStatus -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_LSRead.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_LSRead</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_LSRead">9 --><title>NXT_LSRead</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_LSRead"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_LSRead</h1><!--introduction--><p>Reads data from a digital low speed sensor port (I2C)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#7">Description</a></li><li><a href="#18">Examples</a></li><li><a href="#20">See also</a></li><li><a href="#23">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[data BytesRead] = NXT_LSRead(port)</tt></p><p><tt>[data BytesRead] = NXT_LSRead(port, handle)</tt></p><p><tt>[data BytesRead optionalStatusByte] = NXT_LSRead(port)</tt></p><p><tt>[data BytesRead optionalStatusByte] = NXT_LSRead(port, handle)</tt></p><h2>Description<a name="7"></a></h2><p><tt>[data BytesRead] = NXT_LSRead(port))</tt> gets the <tt>data</tt> of the low speed (digital) sensor value of the given sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The return value <tt>BytesRead</tt> contains the number of bytes available to read.</p><p><tt>[data BytesRead] = NXT_LSRead(port, handle)</tt> uses the given Bluetooth connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system.</p><p><tt>[data BytesRead optionalStatusByte] = NXT_LSRead(port, [handle])</tt> will ignore the automatic statusbyte check and instead return it as output argument. This causes the function to ignore erronous I2C calls or crashes if the sensor is not yet ready. You can effectively save a call to <tt>NXT_LSGetStatus</tt> with this, if you interpret the statusbytes correctly. This may vary, depending on your I2C sensor. The <tt>handle</tt> argument is still optional, like above.</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><p><b>Note:</b></p><p>For LS communication on the NXT, data lengths are limited to 16 bytes per command. Furthermore, this protocol does not support variable-length return packages, so the response will always contain 16 data bytes, with invalid data bytes padded with zeros.</p><p>Before using LS commands, the sensor mode has to be set to <tt>LOWSPEED_9V</tt> using the NXT_SetInputMode command.</p><h2>Examples<a name="18"></a></h2><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); … … 14 14 <span class="comment">% usually we would use NXT_LSWrite before, to request some sort of reply</span> 15 15 [data BytesRead] = NXT_LSRead(SENSOR_1, handle); 16 </pre><h2>See also<a name="20"></a></h2><p> NXT_SetInputMode, NXT_LSWrite, NXT_LSGetStatus, COM_ReadI2C</p><h2>Signature<a name="23"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>17 </p></div><!--16 </pre><h2>See also<a name="20"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="NXT_LSWrite.html">NXT_LSWrite</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, </p><h2>Signature<a name="23"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 17 Published with wg_publish; V1.0<br></p></div><!-- 18 18 ##### SOURCE BEGIN ##### 19 19 %% NXT_LSRead -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_LSWrite.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_LSWrite</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_LSWrite">9 --><title>NXT_LSWrite</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_LSWrite"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_LSWrite</h1><!--introduction--><p>Writes given data to a digital low speed sensor port (I2C)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#14">Example</a></li><li><a href="#16">See also</a></li><li><a href="#19">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_LSWrite(port, RXLength, data, ReplyMode)</tt></p><p><tt>NXT_LSWrite(port, RXLength, data, ReplyMode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_LSWrite(port, RXLength, data, ReplyMode)</tt> writes the given <tt>data</tt> to a low speed (digital) sensor of the given sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The value <tt>RXLength</tt> represents the data length of the expected receiving packet. By the <tt>ReplyMode</tt> one can request an acknowledgement for the packet transmission. The two strings <tt>'reply'</tt> and <tt>'dontreply'</tt> are valid.</p><p><tt>NXT_LSWrite(port, RXLength, data, ReplyMode, handle)</tt> uses the given Bluetooth connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system.</p><p>If no Bluetooth handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><p><b>Note:</b></p><p>For LS communication on the NXT, data lengths are limited to 16 bytes per command. Rx Data Length MUST be specified in the write command since reading from the device is done on a master-slave basis.</p><p>Before using LS commands, the sensor mode has to be set to <tt>LOWSPEED_9V</tt> using the NXT_SetInputMode command.</p><h2>Example<a name="14"></a></h2><pre class="codeinput"> RequestLen = 1; … … 16 16 17 17 NXT_LSWrite(SENSOR_1, RequestLen, I2Cdata, <span class="string">'dontreply'</span>, handle); 18 </pre><h2>See also<a name="16"></a></h2><p> NXT_SetInputMode, NXT_LSRead, NXT_LSGetStatus, COM_ReadI2C</p><h2>Signature<a name="19"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>19 </p></div><!--18 </pre><h2>See also<a name="16"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, </p><h2>Signature<a name="19"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 19 Published with wg_publish; V1.0<br></p></div><!-- 20 20 ##### SOURCE BEGIN ##### 21 21 %% NXT_LSWrite -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_MessageRead.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_MessageRead</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_MessageRead">9 --><title>NXT_MessageRead</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_MessageRead"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_MessageRead</h1><!--introduction--><p>Retrieves a "NXT-to-NXT message" from the specified inbox</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#7">Description</a></li><li><a href="#19">Examples</a></li><li><a href="#21">See also</a></li><li><a href="#24">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[message localInboxReturn] = NXT_MessageRead(LocalInbox, RemoteInbox, RemoveFromRemote)</tt></p><p><tt>[message localInboxReturn] = NXT_MessageRead(LocalInbox, RemoteInbox, RemoveFromRemote, handle)</tt></p><p><tt>[message localInboxReturn statusByte] = NXT_MessageRead(LocalInbox, RemoteInbox, RemoveFromRemote)</tt></p><p><tt>[message localInboxReturn statusByte] = NXT_MessageRead(LocalInbox, RemoteInbox, RemoveFromRemote, handle)</tt></p><h2>Description<a name="7"></a></h2><p>This function reads a NXT-to-NXT bluetooth message from a mailbox queue on the NXT. <tt>LocalInbox</tt> and <tt>RemoteInbox</tt> are the mailbox numbers and must be between 0 and 9. The difference between local and remote mailbox is not fully understood, so it's best to use the same value for both parameters. For more details see the official LEGO Mindstorms communication protocol.</p><p>Set <tt>RemoveFromRemote</tt> to <tt>true</tt> to clear the just retrieved message from the NXT's mailbox (and free occupied memory). Set it to <tt>false</tt> to just "look into" the message while it will still remain on the NXT's message queue.</p><p><tt>message</tt> contains the actual message (string) that has been retrieved. <tt>localInboxReturn</tt> is just the mailbox number that the message was read from (again, see official Mindstorms communication protocol).</p><p>Optionally, the packet's statusbyte is returned in the output argument <tt>statusByte</tt>, if requested. Warning from this functions will then be supressed (i.e. no warnings are raised then).</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p><b>Note:</b></p><p>This command can only be used when an external program (e.g. written in NXT-G, NXC or NBC) is running on the NXT. Otherwise a warning will be thrown (and an empty message will be returned).</p><p>Use this function to read data locally stored on the NXT. There are 10 usable mailbox queues, each with a certain size (so be careful to avoid overflows). Maximum message limit is 58 bytes / chars. This function can be used to communicate with NXC programs (the NXC-function "SendMessage" can be used to write the data on the NXT).</p><h2>Examples<a name="19"></a></h2><pre class="codeinput"> NXT_MessageWrite(<span class="string">'Test message'</span>, 0); … … 14 14 <span class="comment">% and generate / "send" an answer to inbox 1 for us</span> 15 15 reply = NXT_MessageRead(1, 1, true); 16 </pre><h2>See also<a name="21"></a></h2><p> NXT_MessageWrite</p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>17 </p></div><!--16 </pre><h2>See also<a name="21"></a></h2><p><a href="NXT_MessageWrite.html">NXT_MessageWrite</a>, </p><h2>Signature<a name="24"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 17 Published with wg_publish; V1.0<br></p></div><!-- 18 18 ##### SOURCE BEGIN ##### 19 19 %% NXT_MessageRead -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_MessageWrite.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_MessageWrite</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_MessageWrite">9 --><title>NXT_MessageWrite</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_MessageWrite"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_MessageWrite</h1><!--introduction--><p>Writes a "NXT-to-NXT message" to the NXT's incoming BT mailbox queue</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax:</a></li><li><a href="#6">Description:</a></li><li><a href="#13">Examples:</a></li><li><a href="#17">See also</a></li><li><a href="#19">Signature</a></li></ul></div><h2>Syntax:<a name="2"></a></h2><p><tt>NXT_MessageWrite(message)</tt></p><p><tt>NXT_MessageWrite(message, mailbox)</tt></p><p><tt>NXT_MessageWrite(message, mailbox, handle)</tt></p><h2>Description:<a name="6"></a></h2><p><tt>NXT_MessageWrite(message)</tt> sends given <tt>message</tt> to the NXT brick</p><p><tt>NXT_MessageWrite(message, mailbox)</tt> stores <tt>message</tt> in the specified <tt>mailbox</tt>. If no mailbox is specified, default one is 0 (zero)</p><p><tt>NXT_MessageWrite(message, mailbox, handle)</tt> uses the given NXT connection <tt>handle</tt>. If no handle is specified, the default one (<tt>COM_GetDefaultNXT()</tt>) is used.</p><p><b>Note:</b></p><p>Use this function to store data locally on the NXT. There are 10 usable mailbox queues, each with a certain size (so be careful to avoid overflows). Maximum message limit is 58 bytes / chars. This function can be used to communicate with NXC programs (the NXC-function "ReceiveRemoteString" can be used to read the data on the NXT).</p><h2>Examples:<a name="13"></a></h2><pre class="codeinput"> NXT_MessageWrite(<span class="string">'F010045'</span>); … … 13 13 </pre><pre class="codeinput"> handle = COM_OpenNXT(); 14 14 NXT_MessageWrite(<span class="string">'F010045'</span>, 0, handle); 15 </pre><h2>See also<a name="17"></a></h2><p> NXT_MessageRead</p><h2>Signature<a name="19"></a></h2><div><ul><li><b>Author:</b> Laurent Vaylet, The MathWorks SAS (France), Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/17</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="17"></a></h2><p><a href="NXT_MessageRead.html">NXT_MessageRead</a>, </p><h2>Signature<a name="19"></a></h2><div><ul><li><b>Author:</b> Laurent Vaylet, The MathWorks SAS (France), Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/12/17</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% NXT_MessageWrite -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_PlaySoundFile.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_PlaySoundFile</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_PlaySoundFile">9 --><title>NXT_PlaySoundFile</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_PlaySoundFile"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_PlaySoundFile</h1><!--introduction--><p>Plays the given sound file on the NXT Brick</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_PlaySoundFile(filename, 'loop')</tt></p><p><tt>NXT_PlaySoundFile(filename, '', handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_PlaySoundFile(filename, loop)</tt> plays the soundfile stored on NXT Brick determined by the string <tt>filename</tt>. The maximum length is limited to 15 characters. The file extension '.rso' is added automatically if it was omitted. If the loop parameter is equal to <tt>'loop'</tt> the playback loop is activated.</p><p><tt>NXT_PlaySoundFile(name, loop, handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no Bluetooth <tt>handle</tt> is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> NXT_PlaySoundFile(<span class="string">'Goodmorning'</span>, 0); 12 12 </pre><pre class="codeinput"> handle = NXT_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 NXT_StartProgram(<span class="string">'Goodmorning.rso'</span>, 1, handle); 14 </pre><h2>See also<a name="13"></a></h2><p> NXT_StopSoundPlayback</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="13"></a></h2><p><a href="NXT_StopSoundPlayback.html">NXT_StopSoundPlayback</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_PlaySoundFile -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_PlayTone.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_PlayTone</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_PlayTone">9 --><title>NXT_PlayTone</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_PlayTone"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_PlayTone</h1><!--introduction--><p>Plays a tone with the given frequency and duration</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_PlayTone(frequency, duration)</tt></p><p><tt>NXT_PlayTone(frequency, duration, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_PlayTone(frequency, duration)</tt> plays a tone of the <tt>frequency</tt> in Hz (200 - 14000Hz) and the <tt>duration</tt> in milli seconds.</p><p><tt>NXT_PlayTone(frequency, duration, handle)</tt> sends the play tone command over the specific NXT handle (e.g. struct containing a serial handle (PC) / file handle (Linux)).</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> NXT_PlayTone(440, 100); … … 13 13 COM_SetDefaultNXT(handle); 14 14 NXT_PlayTone(1200, 120); 15 </pre><h2>See also<a name="13"></a></h2><p> COM_GetDefaultNXT</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="13"></a></h2><p><a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% NXT_PlayTone -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_ReadIOMap.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_ReadIOMap</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_ReadIOMap">9 --><title>NXT_ReadIOMap</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_ReadIOMap"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_ReadIOMap</h1><!--introduction--><p>Reads the IO map of the given module ID</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>bytes = NXT_ReadIOMap(mod_id, offset, n_bytes)</tt></p><p><tt>bytes = NXT_ReadIOMap(mod_id, offset, n_bytes, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>bytes = NXT_ReadIOMap(mod_id, offset, n_bytes</tt>) returns the data <tt>bytes</tt> of the module identified by the given module ID <tt>mod_id</tt>. The total number of bytes is determined by <tt>n_bytes</tt> and the position of the first byte index by the <tt>offset</tt> parameter.</p><p><tt>bytes = NXT_ReadIOMap(mod_id, offset, n_bytes, handle)</tt> sends the IO map read command over the specific NXT <tt>handle</tt> (e.g. serial handle (PC) / file handle (Linux)).</p><p>If no NXT <tt>handle</tt> is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> OutputModuleID = 131073 … … 14 14 OutputModuleID = 131073 15 15 SoundModuleID = 524289, 0, 30, handle); 16 </pre><h2>See also<a name="13"></a></h2><p> NXT_WriteIOMap, COM_GetDefaultNXT</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>17 </p></div><!--16 </pre><h2>See also<a name="13"></a></h2><p><a href="NXT_WriteIOMap.html">NXT_WriteIOMap</a>, <a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 17 Published with wg_publish; V1.0<br></p></div><!-- 18 18 ##### SOURCE BEGIN ##### 19 19 %% NXT_ReadIOMap -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_ResetInputScaledValue.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_ResetInputScaledValue</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_ResetInputScaledValue">9 --><title>NXT_ResetInputScaledValue</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_ResetInputScaledValue"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_ResetInputScaledValue</h1><!--introduction--><p>Resets the sensor's ScaledVal back to 0 (depends on current sensor mode)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#14">Examples</a></li><li><a href="#17">See also</a></li><li><a href="#19">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_ResetInputScaledValue(port)</tt></p><p><tt>NXT_ResetInputScaledValue(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_ResetInputScaledValue(port)</tt> resets the sensors <tt>ScaledVal</tt> back to <tt>0</tt> of the given sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The <tt>ScaledVal</tt> is set by function <tt>NXT_SetInputMode</tt>.</p><p><tt>NXT_ResetInputScaledValue(port, handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><p><b>Note:</b></p><p>This function should be called after using <tt>NXT_SetInputMode</tt>, before you want to actually use your new special input value (to make sure counting starts at zero). See <tt>NXT_GetInputValues</tt> for more details about what kind of values are returned.</p><h2>Examples<a name="14"></a></h2><pre class="codeinput"> NXT_ResetInputScaledValue(SENSOR_2); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 NXT_ResetInputScaledValue(SENSOR_4, handle); 14 </pre><h2>See also<a name="17"></a></h2><p> NXT_SetInputMode, NXT_GetInputValues</p><h2>Signature<a name="19"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="17"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, </p><h2>Signature<a name="19"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_ResetInputScaledValue -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_ResetMotorPosition.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_ResetMotorPosition</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_ResetMotorPosition">9 --><title>NXT_ResetMotorPosition</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_ResetMotorPosition"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_ResetMotorPosition</h1><!--introduction--><p>Resets NXT internal counter for specified motor, relative or absolute counter</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_ResetMotorPosition(port, isRelative)</tt></p><p><tt>NXT_ResetMotorPosition(port, isRelative, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_ResetMotorPosition(port, isRelative)</tt> resets the NXT internal counter of the given motor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>MOTOR_A</tt>, <tt>MOTOR_B</tt>, <tt>MOTOR_C</tt> analog to the labeling on the NXT Brick. The boolean flag <tt>isRelative</tt> determines the relative (BlockTachoCount) or absolute counter (RotationCount).</p><p><tt>NXT_ResetMotorPosition(port, handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> NXT_ResetMotorPosition(MOTOR_B, true); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 NXT_ResetMotorPosition(MOTOR_A, false, handle); 14 </pre><h2>See also<a name="13"></a></h2><p> NXTMotor, ResetPosition, NXC_ResetErrorCorrection</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="13"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="ResetPosition.html">ResetPosition</a>, <a href="NXC_ResetErrorCorrection.html">NXC_ResetErrorCorrection</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_ResetMotorPosition -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_SendKeepAlive.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_SendKeepAlive</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_SendKeepAlive">9 --><title>NXT_SendKeepAlive</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_SendKeepAlive"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_SendKeepAlive</h1><!--introduction--><p>Sends a KeepAlive packet. Optional: requests sleep time limit.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#15">Examples</a></li><li><a href="#19">See also</a></li><li><a href="#21">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode)</tt></p><p><tt>[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode)</tt> sends a KeepAlive packet to the NXT Brick to get the current sleep time limit of the Brick in milliseconds. By the <tt>ReplyMode</tt> one can request an acknowledgement for the packet transmission. The two strings <tt>'reply'</tt> and <tt>'dontreply'</tt> are valid. <tt>status</tt> indicates if an error occures by the packet transmission. Function <tt>checkStatusBytes</tt> is interpreting this information per default. The value <tt>SleepTimeLimit</tt> contains the time in milliseconds after the NXT brick will turn off automatically. The variable will only be set if <tt>ReplyMode</tt> is <tt>'reply'</tt>. The sleep time limit setting can only be modified using the on-screen-menu on the brick itself.</p><p>Using <tt>'dontreply'</tt> will just send a keep-alive packet. This means, the NXT internal counter when to shut down automatically (this is a setting that can only be accessed directly on the NXT) will be reset. This counter is not an inactivity counter: Bluetooth traffic will NOT stop the NXT from turning off. E.g. if the sleep limit is set to 10 minutes, the only way to keep the NXT Brick from turning off is to send a keep-alive packet within this time.</p><p>If you use replymode <tt>'reply'</tt>, SleepTimeLimit tells you the current setting on the brick, in milliseconds. 0 means sleep timer is disabled. -1 is an invalid answer: You obviously didn't use <tt>'reply'</tt> and still tried to get an answer.</p><p><tt>[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode, handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><p><b>Note:</b></p><p>This function is also called by <tt>COM_OpenNXT()</tt>. Then a keep-alive packet is send and the answer will be received to check for a correctly working bidirectional bluetooth connection.</p><h2>Examples<a name="15"></a></h2><pre class="codeinput"> [status SleepTimeLimit] = NXT_SendKeepAlive(<span class="string">'reply'</span>); … … 13 13 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 14 14 [status SleepTimeLimit] = NXT_SendKeepAlive(<span class="string">'reply'</span>, handle); 15 </pre><h2>See also<a name="19"></a></h2><p> COM_OpenNXT, NXT_GetBatteryLevel</p><h2>Signature<a name="21"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="19"></a></h2><p><a href="COM_OpenNXT.html">COM_OpenNXT</a>, <a href="NXT_GetBatteryLevel.html">NXT_GetBatteryLevel</a>, </p><h2>Signature<a name="21"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% NXT_SendKeepAlive -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_SetBrickName.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_SetBrickName</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_SetBrickName">9 --><title>NXT_SetBrickName</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_SetBrickName"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_SetBrickName</h1><!--introduction--><p>Sets a new name for the NXT Brick (connected to the specified handle)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[NXT_SetBrickName(name)</tt></p><p><tt>NXT_SetBrickName(name, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_SetBrickName(name)</tt> sets a new <tt>name</tt> for the NXT Brick. The value <tt>name</tt> is a string value and determines the new name of the Brick. The maximum length is limited to 15 characters.</p><p><tt>NXT_SetBrickName(name, handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> NXT_SetBrickName(<span class="string">'MyRobot'</span>); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 NXT_SetBrickName(<span class="string">'Mindy'</span>, handle); 14 </pre><h2>See also<a name="13"></a></h2><p> COM_GetDefaultNXT, NXT_SendKeepAlive, NXT_GetBatteryLevel</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="13"></a></h2><p><a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, <a href="NXT_SendKeepAlive.html">NXT_SendKeepAlive</a>, <a href="NXT_GetBatteryLevel.html">NXT_GetBatteryLevel</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_SetBrickName -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_SetInputMode.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_SetInputMode</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_SetInputMode">9 --><title>NXT_SetInputMode</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_SetInputMode"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_SetInputMode</h1><!--introduction--><p>Sets a sensor mode, configures and initializes a sensor to be read out</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#40">Examples</a></li><li><a href="#43">See also</a></li><li><a href="#45">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>status = NXT_SetInputMode(port, SensorTypeDesc, SensorModeDesc, ReplyMode)</tt></p><p><tt>status = NXT_SetInputMode(port, SensorTypeDesc, SensorModeDesc, ReplyMode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>status = NXT_SetInputMode(InputPort, SensorTypeDesc, SensorModeDesc, ReplyMode)</tt> sets mode, configures and initializes the given sensor <tt>port</tt> to be ready to be read out. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The value <tt>SensorTypeDesc</tt> determines the sensor type. See all valid types below. <tt>SensorModeDesc</tt> represents the sensor mode. It specifies what mode the <tt>.ScaledVal</tt> from <tt>NXT_GetInputValues</tt> should be. Valid parameters see below. By the <tt>ReplyMode</tt> one can request an acknowledgement for the packet transmission. The two strings <tt>'reply'</tt> and <tt>'dontreply'</tt> are valid. The return value <tt>status</tt> indicates if an error occures by the packet transmission.</p><p><tt>status = NXT_SetInputMode(InputPort, SensorTypeDesc, SensorModeDesc, ReplyMode, handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p><b>Input:</b></p><p><b><tt>SensorTypeDesc</tt>:</b> Valid types are (all strings):</p><p><tt>NO_SENSOR</tt> (nothing, use to close sensor port)</p><p><tt>SWITCH</tt> (NXT touch sensor, "binary")</p><p><tt>LIGHT_ACTIVE</tt> (NXT light sensor, red LED is on)</p><p><tt>LIGHT_INACTIVE</tt> (NXT light sensor, red LED is off)</p><p><tt>SOUND_DB</tt> (NXT sound sensor, unit dB)</p><p><tt>SOUND_DBA</tt> (NXT sound sensor, unit dBA)</p><p><tt>LOWSPEED</tt> (NXT, passive digital sensor)</p><p><tt>LOWSPEED_9V</tt> (NXT, active digital sensor, e.g. UltraSonic)</p><p><tt>TEMPERATURE</tt> (old RCX sensor)</p><p><tt>REFLECTION</tt> (old RCX sensor)</p><p><tt>ANGLE</tt> (old RCX sensor)</p><p><tt>CUSTOM</tt> (user defined)</p><p><b><tt>SensorModeDesc</tt>:</b> Valid modes are (all strings):</p><p><tt>RAWMODE</tt> (Fastest. RawADVal will be used)</p><p><tt>BOOLEANMODE</tt> (1 if above 45% threshold, else 0)</p><p><tt>TRANSITIONCNTMODE</tt> (count transitions of booleanmode)</p><p><tt>PERIODCOUNTERMODE</tt> (counr periods (up and down transition) of boolean mode)</p><p><tt>PCTFULLSCALEMODE</tt> (normalized percentage between 0 and 100, use .NormalizedADVal instead!)</p><p>More exotic modes are: <tt>CELSIUSMODE</tt> (RCX temperature only)</p><p><tt>FAHRENHEITMODE</tt> (RCX temperature only)</p><p><tt>ANGLESTEPSMODE</tt> (RCX rotation only)</p><p><tt>SLOPEMASK</tt> (what's this???)</p><p><tt>MODEMASK</tt> (what's this???)</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="40"></a></h2><pre class="codeinput"> status = NXT_SetInputMode(SENSOR_1, <span class="string">'SOUND_DB'</span>, <span class="string">'RAWMODE'</span>, <span class="string">'dontreply'</span>); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 status = NXT_SetInputMode(SENSOR_3, <span class="string">'LIGHT_ACTIVE'</span>, <span class="string">'RAWMODE'</span>, <span class="string">'dontreply'</span>, handle); 14 </pre><h2>See also<a name="43"></a></h2><p> NXT_GetInputValues, OpenLight, OpenSound, OpenSwitch, OpenUltrasonic, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="45"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="43"></a></h2><p><a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, <a href="OpenLight.html">OpenLight</a>, <a href="OpenSound.html">OpenSound</a>, <a href="OpenSwitch.html">OpenSwitch</a>, <a href="OpenUltrasonic.html">OpenUltrasonic</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="45"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_SetInputMode -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_SetOutputState.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_SetOutputState</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_SetOutputState">9 --><title>NXT_SetOutputState</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_SetOutputState"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_SetOutputState</h1><!--introduction--><p>Sends previously specified settings to current active motor.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#8">Example</a></li><li><a href="#10">See also</a></li><li><a href="#12">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)</tt></p><p><tt>status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)</tt> sends the given settings like motor <tt>port</tt> (<tt>MOTOR_A</tt>, <tt>MOTOR_B</tt> or <tt>MOTOR_C</tt>), the <tt>power</tt> (<tt>-100...100</tt>, the <tt>IsMotorOn</tt> boolean flag, the <tt>IsBrake</tt> boolean flag, the regulation mode name <tt>RegModeName</tt> (<tt>'IDLE'</tt>, <tt>'SYNC'</tt>, <tt>'SPEED'</tt>), the <tt>TurnRatio</tt> (<tt>-100...100</tt>), the <tt>RunStateName</tt> (<tt>'IDLE'</tt>, <tt>'RUNNING'</tt>, <tt>'RAMUP'</tt>, <tt>'RAMPDOWN'</tt>), the <tt>TachoLimit</tt> (angle limit) in degrees, and the <tt>ReplyMode</tt>. By the <tt>ReplyMode</tt> one can request an acknowledgement for the packet transmission. The two strings <tt>'reply'</tt> and <tt>'dontreply'</tt> are valid. The return value <tt>status</tt> indicates if an error occures by the packet transmission.</p><p><tt>status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system.</p><h2>Example<a name="8"></a></h2><pre class="codeinput"> NXT_SetOutputState(MOTOR_A, 80, true, true, <span class="string">'SPEED'</span>, 0, <span class="string">'RUNNING'</span>, 360, <span class="string">'dontreply'</span>); 12 </pre><h2>See also<a name="10"></a></h2><p> DirectMotorCommand, NXT_GetOutputState, ReadFromNXT, MOTOR_A, MOTOR_B, MOTOR_C</p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>13 </p></div><!--12 </pre><h2>See also<a name="10"></a></h2><p><a href="DirectMotorCommand.html">DirectMotorCommand</a>, <a href="NXT_GetOutputState.html">NXT_GetOutputState</a>, <a href="ReadFromNXT.html">ReadFromNXT</a>, <a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_B.html">MOTOR_B</a>, <a href="MOTOR_C.html">MOTOR_C</a>, </p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 13 Published with wg_publish; V1.0<br></p></div><!-- 14 14 ##### SOURCE BEGIN ##### 15 15 %% NXT_SetOutputState -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_StartProgram.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_StartProgram</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_StartProgram">9 --><title>NXT_StartProgram</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_StartProgram"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_StartProgram</h1><!--introduction--><p>Starts the given program on the NXT Brick</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#6">Description</a></li><li><a href="#11">Examples</a></li><li><a href="#14">See also</a></li><li><a href="#16">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_StartProgram(filename, [handle])</tt></p><p><tt>status = NXT_StartProgram(filename, [handle])</tt></p><h2>Description<a name="6"></a></h2><p><tt>NXT_StartProgram(filename)</tt> starts the embedded NXT Brick program determined by the string <tt>filename</tt>. The maximum length is limited to 15 characters. The file extension <tt>'.rxe'</tt> is added automatically if it was omitted. The output argument <tt>status</tt> is optional and return the error status of the collected packet. If it is omitted, not reply packet will be requested (this is significantly faster via Bluetooth).</p><p>The last parameter <tt>handle</tt> is optional. If no NXT handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="11"></a></h2><pre class="codeinput"> NXT_StartProgram(<span class="string">'ResetCounter'</span>); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 NXT_StartProgram(<span class="string">'Demo.rxe'</span>, handle); 14 </pre><h2>See also<a name="14"></a></h2><p> NXT_StopProgram, NXT_GetCurrentProgramName</p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="14"></a></h2><p><a href="NXT_StopProgram.html">NXT_StopProgram</a>, <a href="NXT_GetCurrentProgramName.html">NXT_GetCurrentProgramName</a>, </p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_StartProgram -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_StopProgram.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_StopProgram</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_StopProgram">9 --><title>NXT_StopProgram</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_StopProgram"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_StopProgram</h1><!--introduction--><p>Stops the currently running program on the NXT Brick</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_StopProgram()</tt></p><p><tt>NXT_StopProgram(handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_StopProgram()</tt> stops the current running embedded NXT Brick program.</p><p><tt>NXT_StopProgram(handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system.</p><p>If no Bluetooth handle is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> NXT_StopProgram(); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 NXT_StopProgram(handle); 14 </pre><h2>See also<a name="13"></a></h2><p> NXT_StartProgram, NXT_GetCurrentProgramName</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="13"></a></h2><p><a href="NXT_StartProgram.html">NXT_StartProgram</a>, <a href="NXT_GetCurrentProgramName.html">NXT_GetCurrentProgramName</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_StopProgram -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_StopSoundPlayback.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_StopSoundPlayback</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_StopSoundPlayback">9 --><title>NXT_StopSoundPlayback</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_StopSoundPlayback"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_StopSoundPlayback</h1><!--introduction--><p>Stops the current sound playback</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_StopSoundPlayback()</tt></p><p><tt>NXT_StopSoundPlayback(handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_StopSoundPlayback()</tt> stops the current sound playback.</p><p><tt>NXT_StopSoundPlayback(handle)</tt> sends the stop sound playback command over the specific Bluetooth <tt>handle</tt> (serial handle (PC) / file handle (Linux)).</p><p>If no NXT <tt>handle</tt> is specified the default one (<tt>COM_GetDefaultNXT</tt>) is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> NXT_StopSoundPlayback(); 12 12 </pre><pre class="codeinput"> handle = COM_OpenNXT(<span class="string">'bluetooth.ini'</span>); 13 13 NXT_StopSoundPlayback(handle); 14 </pre><h2>See also<a name="13"></a></h2><p> NXT_PlaySoundFile, NXT_PlayTone, COM_GetDefaultNXT</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="13"></a></h2><p><a href="NXT_PlaySoundFile.html">NXT_PlaySoundFile</a>, <a href="NXT_PlayTone.html">NXT_PlayTone</a>, <a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% NXT_StopSoundPlayback -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/NXT_WriteIOMap.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>NXT_WriteIOMap</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_NXT_WriteIOMap">9 --><title>NXT_WriteIOMap</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_NXT_WriteIOMap"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>NXT_WriteIOMap</h1><!--introduction--><p>Writes the IO map to the given module ID</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#14">See also</a></li><li><a href="#16">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>NXT_WriteIOMap(mod_id, offset, n_bytes, data)</tt></p><p><tt>NXT_WriteIOMap(mod_id, offset, n_bytes, data, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>NXT_WriteIOMap(mod_id, offset, n_bytes, data)</tt> write the data <tt>bytes</tt> to the given module ID (<tt>mod_id</tt>). The total number of bytes is given by <tt>n_bytes</tt>. The <tt>offset</tt> parameter determines the index position of the first byte.</p><p><tt>NXT_WriteIOMap(mod_id, offset, n_bytes, data, handle)</tt> sends the IO map write command over the specific NXT handle <tt>handle</tt> (e.g. serial handle (PC) / file handle (Linux)).</p><p>If no NXT <tt>handle</tt> is specified the default one (<tt>COM_GetDefaultNXT)</tt> is used.</p><p>For more details see the official LEGO Mindstorms communication protocol.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> OutputModuleID = 131073 … … 14 14 OutputModuleID = 131073 15 15 NXT_WriteIOMap(OutputModuleID, 0, 30, bytes, handle); 16 </pre><h2>See also<a name="14"></a></h2><p> NXT_ReadIOMap, COM_GetDefaultNXT</p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>17 </p></div><!--16 </pre><h2>See also<a name="14"></a></h2><p><a href="NXT_ReadIOMap.html">NXT_ReadIOMap</a>, <a href="COM_GetDefaultNXT.html">COM_GetDefaultNXT</a>, </p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/05/22</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 17 Published with wg_publish; V1.0<br></p></div><!-- 18 18 ##### SOURCE BEGIN ##### 19 19 %% NXT_WriteIOMap -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenAccelerator.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenAccelerator</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenAccelerator">9 --><title>OpenAccelerator</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenAccelerator"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenAccelerator</h1><!--introduction--><p>Initializes the HiTechnic acceleration sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#8">Examples</a></li><li><a href="#10">See also</a></li><li><a href="#12">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenAccelerator(port)</tt></p><p><tt>OpenAccelerator(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenAccelerator(port)</tt> initializes the input mode of NXT accelerator sensor specified by the sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Examples<a name="8"></a></h2><pre class="codeinput"> OpenAccelerator(SENSOR_4); 12 12 acc_Vector = GetAccelerator(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="10"></a></h2><p> GetAccelerator, CloseSensor, COM_ReadI2C, NXT_LSGetStatus, NXT_LSRead</p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="10"></a></h2><p><a href="GetAccelerator.html">GetAccelerator</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, </p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenAccelerator -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenColor.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenColor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenColor">9 --><title>OpenColor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenColor"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenColor</h1><!--introduction--><p>Initializes the HiTechnic color sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#11">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenColor(port)</tt></p><p><tt>OpenColor(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenColor(port)</tt> initializes the input mode of HiTechnic Color sensor specified by the sensor port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>With <tt>GetColor(port)</tt> you can receive color values as RGB or Index.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>Since the Color sensor is a digital sensor (that uses the I²C protocol), the function <tt>NXT_SetInputMode</tt> cannot be used as for analog sensors.</p><h2>Examples<a name="11"></a></h2><pre class="codeinput"> OpenColor(SENSOR_2); 12 12 [index r g b] = GetColor(SENSOR_2, 0); 13 13 CloseSensor(SENSOR_2); 14 </pre><h2>See also<a name="13"></a></h2><p> GetColor, CloseSensor, COM_ReadI2C, NXT_LSGetStatus, NXT_LSRead</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/10/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="13"></a></h2><p><a href="GetColor.html">GetColor</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/10/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenColor -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenCompass.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenCompass</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenCompass">9 --><title>OpenCompass</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenCompass"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenCompass</h1><!--introduction--><p>Initializes the HiTechnic magnetic compass sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#11">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenCompass(port)</tt></p><p><tt>OpenCompass(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenCompass(port)</tt> initializes the input mode of HiTechnic compass sensor specified by the sensor port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>With <tt>GetCompass(port)</tt> you can receive the heading value ranging from 0 to 359.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>Since the compass sensor is a digital sensor (that uses the I²C protocol), the function <tt>NXT_SetInputMode</tt> cannot be used as for analog sensors.</p><h2>Examples<a name="11"></a></h2><pre class="codeinput"> OpenCompass(SENSOR_2); 12 12 degree = GetCompass(SENSOR_2); 13 13 CloseSensor(SENSOR_2); 14 </pre><h2>See also<a name="13"></a></h2><p> GetCompass, CloseSensor, COM_ReadI2C, NXT_LSGetStatus, NXT_LSRead</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="13"></a></h2><p><a href="GetCompass.html">GetCompass</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="COM_ReadI2C.html">COM_ReadI2C</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/08/01</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenCompass -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenGyro.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenGyro</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenGyro">9 --><title>OpenGyro</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenGyro"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenGyro</h1><!--introduction--><p>Initializes the HiTechnic Gyroscopic sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#13">Examples</a></li><li><a href="#15">See also</a></li><li><a href="#17">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenGyro(port)</tt></p><p><tt>OpenGyro(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenGyro(port)</tt> initializes the HiTechnic Gyro sensor on the specified sensor port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>Before the sensor can be used, <tt>CalibrateGyro</tt> has to be called.</p><p>With <tt>GetGyro(port)</tt> you can receive Gyro values up to a max. of +/- 360° rotation rate per sec.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p><b>Note:</b></p><p>For more details on calibration, see help text and examples of <tt>CalibrateGyro</tt>.</p><h2>Examples<a name="13"></a></h2><pre class="codeinput"> OpenGyro(SENSOR_2); … … 13 13 speed = GetGyro(SENSOR_2); 14 14 CloseSensor(SENSOR_2); 15 </pre><h2>See also<a name="15"></a></h2><p> CalibrateGyro, GetGyro, CloseSensor, NXT_SetInputMode, NXT_GetInputValues</p><h2>Signature<a name="17"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="15"></a></h2><p><a href="CalibrateGyro.html">CalibrateGyro</a>, <a href="GetGyro.html">GetGyro</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, </p><h2>Signature<a name="17"></a></h2><div><ul><li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/31</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% OpenGyro -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenInfrared.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenInfrared</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenInfrared">9 --><title>OpenInfrared</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenInfrared"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenInfrared</h1><!--introduction--><p>Initializes the HiTechnic infrared seeker sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#8">Examples</a></li><li><a href="#10">See also</a></li><li><a href="#12">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenInfrared(port)</tt></p><p><tt>OpenInfrared(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenInfrared(port)</tt> initializes the input mode of HiTechnic infrared seeker sensor specified by the sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><h2>Examples<a name="8"></a></h2><pre class="codeinput"> OpenInfrared(SENSOR_4); 12 12 [direction rawData] = GetInfrared(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="10"></a></h2><p> GetInfrared, CloseSensor, NXT_LSGetStatus, NXT_LSRead</p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="10"></a></h2><p><a href="GetInfrared.html">GetInfrared</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, <a href="NXT_LSRead.html">NXT_LSRead</a>, </p><h2>Signature<a name="12"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenInfrared -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenLight.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenLight</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenLight">9 --><title>OpenLight</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenLight"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenLight</h1><!--introduction--><p>Initializes the NXT light sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Example</a></li><li><a href="#11">See also</a></li><li><a href="#13">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenLight(port, mode)</tt></p><p><tt>OpenLight(port, mode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenLight(port, mode)</tt> initializes the input mode of NXT light sensor specified by the sensor <tt>port</tt> and the light <tt>mode</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The <tt>mode</tt> represents one of two modes <tt>'ACTIVE'</tt> (active illumination: red light on) and <tt>'INACTIVE'</tt> (passive illumination red light off). To deactive the active illumination the function <tt>CloseSensor</tt> is used.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>For more complex settings the function <tt>NXT_SetInputMode</tt> can be used.</p><h2>Example<a name="9"></a></h2><pre class="codeinput"> OpenLight(SENSOR_1, <span class="string">'ACTIVE'</span>); 12 12 light = GetLight(SENSOR_1); 13 13 CloseSensor(SENSOR_1); 14 </pre><h2>See also<a name="11"></a></h2><p> NXT_SetInputMode, CloseSensor, GetLight, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="11"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="GetLight.html">GetLight</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenLight -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenRFID.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenRFID</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenRFID">9 --><title>OpenRFID</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenRFID"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenRFID</h1><!--introduction--><p>Initializes the Codatex RFID sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#10">Example</a></li><li><a href="#12">See also</a></li><li><a href="#14">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>status = OpenRFID(port)</tt></p><h2>Description<a name="4"></a></h2><p><tt>OpenRFID(port)</tt> initializes the input mode of Codatex RFID sensor specified by the sensor port. The value port can be addressed by the symbolic constants <tt>SENSOR_1</tt>, <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The RF ID Sensor works with 125 kHz transponders compatible with EM4102 modulation type. With this sensor you can read 5-byte-long transponder numbers into the NXT. Since the NXT RFID sensor is a digital sensor (that uses the I²C protocol), the function <tt>NXT_SetInputMode</tt> cannot be used as for analog sensors.</p><p><b>Note:</b></p><p>Opening the sensor can take a while. Via Bluetooth, delays of more than 1 second are not uncommon.</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> OpenRFID(SENSOR_2); 12 12 transID = GetRFID(SENSOR_2,<span class="string">'single'</span>); 13 13 CloseSensor(SENSOR_2); 14 </pre><h2>See also<a name="12"></a></h2><p> GetRFID, CloseSensor</p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/12/1</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="12"></a></h2><p><a href="GetRFID.html">GetRFID</a>, <a href="CloseSensor.html">CloseSensor</a>, </p><h2>Signature<a name="14"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Rainer Schnitzler (see AUTHORS)</li><li><b>Date:</b> 2008/12/1</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenRFID -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenSound.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenSound</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenSound">9 --><title>OpenSound</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenSound"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenSound</h1><!--introduction--><p>Initializes the NXT sound sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Examples</a></li><li><a href="#11">See also</a></li><li><a href="#13">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenSound(port, mode)</tt></p><p><tt>OpenSound(port, mode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenSound(port, mode)</tt> initializes the input mode of NXT sound sensor specified by the sensor <tt>port</tt> and the sound <tt>mode</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. The <tt>mode</tt> represents one of two modes <tt>'DB'</tt> (dB measurement) and <tt>'DBA'</tt> (dBA measurement)</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>For more complex settings the function <tt>NXT_SetInputMode</tt> can be used.</p><h2>Examples<a name="9"></a></h2><pre class="codeinput"> OpenSound(SENSOR_1, <span class="string">'DB'</span>); 12 12 sound = GetSound(SENSOR_1); 13 13 CloseSensor(SENSOR_1); 14 </pre><h2>See also<a name="11"></a></h2><p> NXT_SetInputMode, GetSound, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="11"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="GetSound.html">GetSound</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenSound -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenSwitch.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenSwitch</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenSwitch">9 --><title>OpenSwitch</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenSwitch"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenSwitch</h1><!--introduction--><p>Initializes the NXT touch sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Example</a></li><li><a href="#11">See also</a></li><li><a href="#13">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenSwitch(port)</tt></p><p><tt>OpenSwitch(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OpenSound(port)</tt> initializes the input mode of NXT switch / touch sensor specified by the sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>For more complex settings the function <tt>NXT_SetInputMode</tt> can be used.</p><h2>Example<a name="9"></a></h2><pre class="codeinput"> OpenSwitch(SENSOR_4); 12 12 switchState = GetSwitch(SENSOR_4); 13 13 CloseSensor(SENSOR_4); 14 </pre><h2>See also<a name="11"></a></h2><p> NXT_SetInputMode, GetSwitch, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>15 </p></div><!--14 </pre><h2>See also<a name="11"></a></h2><p><a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="GetSwitch.html">GetSwitch</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="13"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 15 Published with wg_publish; V1.0<br></p></div><!-- 16 16 ##### SOURCE BEGIN ##### 17 17 %% OpenSwitch -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OpenUltrasonic.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OpenUltrasonic</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OpenUltrasonic">9 --><title>OpenUltrasonic</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OpenUltrasonic"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OpenUltrasonic</h1><!--introduction--><p>Initializes the NXT ultrasonic sensor, sets correct sensor mode</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#6">Description</a></li><li><a href="#15">Limitations</a></li><li><a href="#18">Examples</a></li><li><a href="#21">See also</a></li><li><a href="#23">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OpenUltrasonic(port)</tt></p><p><tt>OpenUltrasonic(port, mode)</tt></p><p><tt>OpenUltrasonic(port, mode, handle)</tt></p><h2>Description<a name="6"></a></h2><p><tt>OpenUltrasonic(port)</tt> initializes the input mode of NXT ultrasonic sensor specified by the sensor <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick.</p><p><tt>OpenUltrasonic(port, mode)</tt> can enable the snapshot mode if the value <tt>mode</tt> is equal to the string <tt>'snapshot'</tt>. This mode provides the snap shot mode (or SINGLE_SHOT mode) of the NXT ultrasonic sensor, which provides several sensor readings in one step. See <tt>USMakeSnapshot</tt> for more information.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>Since the NXT ultrasonic sensor is a digital sensor (that uses the I²C protocol), the function <tt>NXT_SetInputMode</tt> cannot be used as for analog sensors.</p><p><b>Note:</b></p><p>When the US sensor is opened in snapshot mode, the function <tt>GetUltrasonic</tt> does not work correctly!</p><h2>Limitations<a name="15"></a></h2><p>Since the Ultrasonic sensors all operate at the same frequency, multiple US sensors will interfere with each other! If multiple US sensors can "see each other" (or their echos and reflections), results will be unpredictable (and probably also unusable). You can avoid this problem by turning off US sensors, or operating them in snapshot mode (see also <tt>USMakeSnapshot</tt> and <tt>USGetSnapshotResults</tt>).</p><h2>Examples<a name="18"></a></h2><pre class="codeinput"> OpenUltrasonic(SENSOR_4); … … 21 21 echos = USGetSnapshotResults(port); 22 22 CloseSensor(SENSOR_4); 23 </pre><h2>See also<a name="21"></a></h2><p> GetUltrasonic, USMakeSnapshot, USGetSnapshotResults, CloseSensor</p><h2>Signature<a name="23"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/08</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>24 </p></div><!--23 </pre><h2>See also<a name="21"></a></h2><p><a href="GetUltrasonic.html">GetUltrasonic</a>, <a href="USMakeSnapshot.html">USMakeSnapshot</a>, <a href="USGetSnapshotResults.html">USGetSnapshotResults</a>, <a href="CloseSensor.html">CloseSensor</a>, </p><h2>Signature<a name="23"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/08</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 24 Published with wg_publish; V1.0<br></p></div><!-- 25 25 ##### SOURCE BEGIN ##### 26 26 %% OpenUltrasonic -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/OptimizeToolboxPerformance.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>OptimizeToolboxPerformance</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_OptimizeToolboxPerformance">9 --><title>OptimizeToolboxPerformance</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_OptimizeToolboxPerformance"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>OptimizeToolboxPerformance</h1><!--introduction--><p>Copies binary versions of typecastc to toolbox for better performance</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#11">Example</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OptimizeToolboxPerformance</tt></p><h2>Description<a name="5"></a></h2><p>This script automates toolbox optimization. The private functions wordbytes2dec and dec2wordbytes are very frequently called and thus most critical for performance (mostly, but not only CPU load), especially at high packet rates (USB). Profiling shows the bottleneck: typecast. When using the binary version from the MATLAB directory, speed-ups up to 300% can be experienced. However this binary version is in a private directory, so cannot be called directly. Also it depends on the OS, CPU architecture and MATLAB version used. So, the only solution: We copy those binary files to our own toolboxes private directory.</p><p>The script asks the user for permission and performs the file actions automatically. After each step the results will be checked to avoid a corrupt toolbox.</p><p>During the process, the m-files for the above named functions will be overwritten. This is the reason we provide 2 versions in the private dir, .m.slow (the original with typecast) and .m.fast (optimized version that needs binary typecastc files in the same directory).</p><h2>Example<a name="11"></a></h2><pre class="codeinput"> OptimizeToolboxPerformance 12 </pre><h2>See also<a name="13"></a></h2><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/09/19</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 13 </p></div><!--12 13 Published with wg_publish; V1.0<br></p></div><!-- 14 14 ##### SOURCE BEGIN ##### 15 15 %% OptimizeToolboxPerformance -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/ReadFromNXT.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>ReadFromNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_ReadFromNXT">9 --><title>ReadFromNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_ReadFromNXT"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>ReadFromNXT</h1><!--introduction--><p>Reads current state of specified motor(s) from NXT brick</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#7">Description</a></li><li><a href="#32">Limitations:</a></li><li><a href="#35">Examples:</a></li><li><a href="#40">See also</a></li><li><a href="#42">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>DATA = OBJ.ReadFromNXT</tt></p><p><tt>DATA = OBJ.ReadFromNXT(HANDLE)</tt></p><p><tt>[DATA1 DATA2] = OBJ.ReadFromNXT</tt></p><p><tt>[DATA1 DATA2] = OBJ.ReadFromNXT(HANDLE)</tt></p><h2>Description<a name="7"></a></h2><p>Request the current state of the motor object <tt>OBJ</tt> from the NXT brick. NXTMotor object <tt>OBJ</tt> is not modified. <tt>DATA</tt> is a structure with property/value pairs.</p><p>If the NXTMotor object <tt>OBJ</tt> controls two motors, <tt>DATA1</tt> and <tt>DATA2</tt> hold the parameters of the first and the second motor respectively. If only one output argument is given, the parameters of the first motor are returned.</p><p>Use the optional parameter <tt>HANDLE</tt> to identifiy the connection to use for this command. Otherwise the default handle (see <tt>COM_SetDefaultNXT</tt>) will be used.</p><p>The returned struct contains the following fields:</p><div><ul><li><tt>Port</tt> - The motor port these data apply to.</li></ul></div><div><ul><li><tt>Power</tt> - The currently set power level (from -100 to 100).</li></ul></div><div><ul><li><tt>Position</tt> - The motor's position in degrees (of the internal rotation sensor). These encoders should be accurate to +/- 1 degree. Values will increase positively during forward motion, and decrease during reverse motion. You can reset this counter by using the method <tt>.ResetPosition</tt>.</li></ul></div><div><ul><li><tt>IsRunning</tt> - A boolean indicating wether the motor is currently spinning or actively braking (after having called <tt>Stop('brake')</tt>. It will only be false once the motor is in free-running "coast" mode, i.e. when the power to this motor is turned off (i.e. after calling <tt>Stop('off')</tt> or when the set <tt>TachoLimit</tt> was reached). To clarify: if a motor was stopped using <tt>.Stop('brake')</tt>, or if <tt>.ActionAtTachoLimit</tt> was set to <tt>'HoldBrake'</tt>, <tt>IsRunning</tt> will keep returning true! Use the method <tt>.WaitFor</tt> to check wether a motor is ready to accept new commands!</li></ul></div><div><ul><li><tt>SpeedRegulation</tt> - A boolean indicating wether the motor currently uses speed regulation. This is turned off during synchronous driving (when driving with 2 motors at the same time).</li></ul></div><div><ul><li><tt>TachoLimit</tt> - The currently set goal for the motor to reach. If set to 0, the motor is spinning forever.</li></ul></div><div><ul><li><tt>TachoCount</tt> - This counter indicates the progress of the motor for its current goal -- i.e. if a <tt>TachoLimit ~= 0</tt> is set, <tt>TachoCount</tt> will count up to this value during movement.</li></ul></div><p><b>Note:</b></p><p>The values of <tt>TachoCount</tt> and <tt>TachoLimit</tt> (which can nicely be used as progress indicators) are not guaranteed to keep being valid once motor movement has finished. They can/will be cleared by the next <tt>SendToNXT</tt>, <tt>Stop</tt>, <tt>StopMotor</tt> or maybe even <tt>DirectMotorCommand</tt>.</p><p>For advanced users: The field <tt>Position</tt> maps to the NXT firmware's register / IOmap counter <tt>RotationCount</tt>, and <tt>TachoCount</tt> maps to <tt>TachoCount</tt> as expected.</p><h2>Limitations:<a name="32"></a></h2><p>Apart from the previously mentioned limitation of <tt>IsRunning</tt> (return values slightly differ from what would be expected), the value of <tt>SpeedRegulation</tt> can sometimes be unexpected: The <tt>DATA</tt> struct returned by <tt>ReadFromNXT</tt> always returns the true state of the NXT's firmware registers (it's basically just a wrapper for <tt>NXT_GetOutputState</tt>). When using an <tt>NXTMotor</tt> object with <tt>SpeedRegulation = true</tt>, the regulation will only be enabled during drivin. When the motor control starts braking, regulation will be disabled, and this is what <tt>ReadFromNXT</tt> shows you. So don't worry when you receive <tt>SpeedRegulation = false</tt> using this method, also you clearly enabled speed regulation. This is by design, and the motor did in fact use speed regulation during its movement.</p><h2>Examples:<a name="35"></a></h2><pre class="codeinput"> <span class="comment">% Move motor A and show its state after 3 seconds</span> … … 31 31 data = motorA.ReadFromNXT(); <span class="comment">% refresh</span> 32 32 <span class="keyword">end</span><span class="comment">%while</span> 33 </pre><h2>See also<a name="40"></a></h2><p> NXTMotor, SendToNXT, ResetPosition, NXT_GetOutputState</p><h2>Signature<a name="42"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/11/12</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>34 </p></div><!--33 </pre><h2>See also<a name="40"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="SendToNXT.html">SendToNXT</a>, <a href="ResetPosition.html">ResetPosition</a>, <a href="NXT_GetOutputState.html">NXT_GetOutputState</a>, </p><h2>Signature<a name="42"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/11/12</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 34 Published with wg_publish; V1.0<br></p></div><!-- 35 35 ##### SOURCE BEGIN ##### 36 36 %% ReadFromNXT -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/ResetPosition.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>ResetPosition</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_ResetPosition">9 --><title>ResetPosition</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_ResetPosition"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>ResetPosition</h1><!--introduction--><p>Resets the position counter of the given motor(s).</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#12">Example:</a></li><li><a href="#14">See also</a></li><li><a href="#16">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OBJ.ResetPosition()</tt></p><p><tt>OBJ.ResetPosition(HANDLE)</tt></p><h2>Description<a name="5"></a></h2><p>Reset the position of the motor specified in <tt>OBJ</tt>. Only the internal states of the NXT brick corresponding to the specified motor(s) are reset. The motor is not moved. This resets the field <tt>.Position</tt> you can read out using <tt>.ReadFromNXT</tt>.</p><p>Specify <tt>HANDLE</tt> (optional) to identifiy the connection to use for this command. Otherwise the defaul handle (set using <tt>COM_SetDefaultNXT</tt>) will be used.</p><p><b>Note:</b></p><p>For advanced users: The field <tt>Position</tt> maps to the NXT firmware's register / IOmap counter <tt>RotationCount</tt>. It can also be reset using <tt>NXT_ResetMotorPosition(port, false)</tt>. That's in fact what this method does.</p><h2>Example:<a name="12"></a></h2><pre class="codeinput"> motorC = NXTMotor(<span class="string">'C'</span>, <span class="string">'Power'</span>, -20, <span class="string">'TachoLimit'</span>, 120); … … 32 32 <span class="comment">% TachoCount: -120</span> 33 33 <span class="comment">% Position: 0</span> 34 </pre><h2>See also<a name="14"></a></h2><p> NXTMotor, ReadFromNXT, NXT_ResetMotorPosition, NXT_GetOutputState, NXC_ResetErrorCorrection</p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>35 </p></div><!--34 </pre><h2>See also<a name="14"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="ReadFromNXT.html">ReadFromNXT</a>, <a href="NXT_ResetMotorPosition.html">NXT_ResetMotorPosition</a>, <a href="NXT_GetOutputState.html">NXT_GetOutputState</a>, <a href="NXC_ResetErrorCorrection.html">NXC_ResetErrorCorrection</a>, </p><h2>Signature<a name="16"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/08/25</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 35 Published with wg_publish; V1.0<br></p></div><!-- 36 36 ##### SOURCE BEGIN ##### 37 37 %% ResetPosition -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/SENSOR_1.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>SENSOR_1</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_SENSOR_1">9 --><title>SENSOR_1</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_SENSOR_1"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>SENSOR_1</h1><!--introduction--><p>Symbolic constant SENSOR_1 (returns 0)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>port1 = SENSOR_1()</tt></p><h2>Description<a name="4"></a></h2><p><tt>port1 = SENSOR_1()</tt> returns <tt>0</tt> as the value <tt>port1</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> port1 = SENSOR_1() 12 12 <span class="comment">%result: >> port1 = 0</span> 13 </pre><h2>See also<a name="8"></a></h2><p> SENSOR_2, SENSOR_3, SENSOR_4</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% SENSOR_1 -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/SENSOR_2.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>SENSOR_2</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_SENSOR_2">9 --><title>SENSOR_2</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_SENSOR_2"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>SENSOR_2</h1><!--introduction--><p>Symbolic constant SENSOR_2 (returns 1)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>port2 = SENSOR_2()</tt></p><h2>Description<a name="4"></a></h2><p><tt>port2 = SENSOR_2()</tt> returns <tt>1</tt> as the value <tt>port2</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> port2 = SENSOR_2() 12 12 <span class="comment">%result: >> port2 = 1</span> 13 </pre><h2>See also<a name="8"></a></h2><p> SENSOR_1, SENSOR_3, SENSOR_4</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_3.html">SENSOR_3</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% SENSOR_2 -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/SENSOR_3.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>SENSOR_3</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_SENSOR_3">9 --><title>SENSOR_3</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_SENSOR_3"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>SENSOR_3</h1><!--introduction--><p>Symbolic constant SENSOR_3 (returns 2)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>port3 = SENSOR_3()</tt></p><h2>Description<a name="4"></a></h2><p><tt>port3 = SENSOR_3()</tt> returns <tt>2</tt> as the value <tt>port3</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> port3 = SENSOR_3() 12 12 <span class="comment">%result: >> port3 = 2</span> 13 </pre><h2>See also<a name="8"></a></h2><p> SENSOR_1, SENSOR_2, SENSOR_4</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_4.html">SENSOR_4</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% SENSOR_3 -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/SENSOR_4.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>SENSOR_4</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_SENSOR_4">9 --><title>SENSOR_4</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_SENSOR_4"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>SENSOR_4</h1><!--introduction--><p>Symbolic constant SENSOR_4 (returns 3)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>port4 = SENSOR_4()</tt></p><h2>Description<a name="4"></a></h2><p><tt>port4 = SENSOR_4()</tt> returns <tt>3</tt> as the value <tt>port4</tt>.</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> port4 = SENSOR_4() 12 12 <span class="comment">%result: >> port4 = 3</span> 13 </pre><h2>See also<a name="8"></a></h2><p> SENSOR_1, SENSOR_2, SENSOR_3</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="SENSOR_1.html">SENSOR_1</a>, <a href="SENSOR_2.html">SENSOR_2</a>, <a href="SENSOR_3.html">SENSOR_3</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% SENSOR_4 -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/SendToNXT.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>SendToNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_SendToNXT">9 --><title>SendToNXT</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_SendToNXT"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>SendToNXT</h1><!--introduction--><p>Send motor settings to the NXT brick</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#9">Limitations</a></li><li><a href="#14">Example:</a></li><li><a href="#16">See also</a></li><li><a href="#18">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OBJ.SendToNXT</tt></p><p><tt>OBJ.SendToNXT(HANDLE)</tt></p><h2>Description<a name="5"></a></h2><p><tt>OBJ.SendToNXT</tt> sends the motor settings in <tt>OBJ</tt> to the NXT brick.</p><p><tt>OBJ.SendToNXT(HANDLE)</tt> uses <tt>HANDLE</tt> to identifiy the connection to use for this command. This is optional. Otherwise the defaul handle (set using <tt>COM_SetDefaultNXT</tt>) will be used.</p><p>For a valid list of properties and how they affect the motors' behaviour, see the documentation for the class constructor <tt>NXTMotor</tt>.</p><h2>Limitations<a name="9"></a></h2><p>With <tt>ActionAtTachoLimit = 'Coast'</tt> and synchronous driving (two motors), the motors will stay synced after movement (even after <tt>.WaitFor()</tt> has finished). This is by design. To disable the synchonization, just use <tt>.Stop</tt>.</p><p>If you send a command to the NXT without waiting for the previous motor operation to have finished, the command will be dropped (the NXT indicates this with a high and low beep tone). Use the motor-objects method <tt>.WaitFor</tt> to make sure the motor is ready for new commands, or stop the motor(s) using <tt>.Stop</tt>.</p><h2>Example:<a name="14"></a></h2><pre class="codeinput"> motor = NXTMotor(<span class="string">'A'</span>, <span class="string">'Power'</span>, 50, <span class="string">'TachoLimit'</span>, 200); … … 13 13 motor.WaitFor(); 14 14 NXT_PlayTone(400,500); 15 </pre><h2>See also<a name="16"></a></h2><p> NXTMotor, ReadFromNXT, Stop, WaitFor, DirectMotorCommand</p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Aulis Telle, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/07/12</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="16"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="ReadFromNXT.html">ReadFromNXT</a>, <a href="Stop.html">Stop</a>, <a href="WaitFor.html">WaitFor</a>, <a href="DirectMotorCommand.html">DirectMotorCommand</a>, </p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Aulis Telle, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/07/12</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% SendToNXT -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/Stop.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>Stop</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_Stop">9 --><title>Stop</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_Stop"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>Stop</h1><!--introduction--><p>Stops or brakes specified motor(s)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#6">Description</a></li><li><a href="#20">Example:</a></li><li><a href="#22">See also</a></li><li><a href="#25">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OBJ.Stop()</tt></p><p><tt>OBJ.Stop(BRAKEMODE)</tt></p><p><tt>OBJ.Stop(BRAKEMODE, HANDLE)</tt></p><h2>Description<a name="6"></a></h2><p><tt>OBJ.Stop()</tt> is the same as <tt>OBJ.Stop('off')</tt>.</p><p><tt>OBJ.Stop(BRAKEMODE)</tt> stops the motor specified in <tt>OBJ</tt> with the brakemode specified in <tt>BRAKEMODE</tt>:</p><p><tt>BRAKEMODE</tt> can take the following values:</p><p><tt>'nobrake'</tt>, <tt>'off'</tt>, 0, <tt>false</tt>: The electrical power to the specified motor is simply disconnected, the so-called "COAST" mode. Motor will keep spinning until it comes to a soft stop.</p><p><tt>'brake'</tt>, <tt>'on'</tt>, 1, <tt>true</tt>: This will actively halt the motor at the current position (until the next movement command); it's a "hard brake".</p><p>Use <tt>HANDLE</tt> to identify the connection to use for this command (optional).</p><p><b>Note:</b></p><p>To stop all motors at precisely the same time, please see the command <tt>StopMotor</tt>. It can be called with the syntax <tt>StopMotor('all', 'off')</tt> or <tt>StopMotor('all', 'brake')</tt>. When comparing this to the <tt>obj.Stop</tt> method, it acts more precise when wanting to stop multiple motors at the same time...</p><p>Using the active brake (e.g. <tt>.Stop('brake')</tt>) can be very power consuming, so watch your battery level when using this functionality for long periods of time.</p><h2>Example:<a name="20"></a></h2><pre class="codeinput"> motorC = NXTMotor(<span class="string">'C'</span>, <span class="string">'Power'</span>, -100, <span class="string">'TachoLimit'</span>, 0); … … 13 13 pause(4); <span class="comment">% wait 4 seconds</span> 14 14 motorC.Stop(<span class="string">'brake'</span>); 15 </pre><h2>See also<a name="22"></a></h2><p> NXTMotor, WaitFor, StopMotor</p><h2>Signature<a name="25"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>16 </p></div><!--15 </pre><h2>See also<a name="22"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="WaitFor.html">WaitFor</a>, <a href="StopMotor.html">StopMotor</a>, </p><h2>Signature<a name="25"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 16 Published with wg_publish; V1.0<br></p></div><!-- 17 17 ##### SOURCE BEGIN ##### 18 18 %% Stop -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/StopMotor.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>StopMotor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_StopMotor">9 --><title>StopMotor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_StopMotor"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>StopMotor</h1><!--introduction--><p>Stops / brakes specified motor. (Synchronisation will be lost after this)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#13">Limitations:</a></li><li><a href="#15">Example</a></li><li><a href="#19">See also</a></li><li><a href="#21">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>StopMotor(port, mode)</tt></p><p><tt>StopMotor(port, mode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>StopMotor(port, mode)</tt> stops the motor connected to the given <tt>port</tt>. The value <tt>port</tt> can be addressed by the symbolic constants <tt>MOTOR_A</tt>, <tt>MOTOR_B</tt>, <tt>MOTOR_C</tt> and <tt>'all'</tt> (all motor at at the same time) analog to the labeling on the NXT Brick. The argument <tt>mode</tt> can be equal to <tt>'off'</tt> (or <tt>'nobrake'</tt> or <tt>false</tt>) which cuts off the electrical power to the specific motor, so called "COAST" mode. The option <tt>'brake'</tt> (or <tt>'on'</tt> or <tt>true</tt>) will actively halt the motor at the current position (until the next command).</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p><b>Note:</b></p><p>The value <tt>port</tt> equal to <tt>'all'</tt> can be used to stopp all motors at the same time using only one single Bluetooth packet. After a <tt>StopMotor</tt> command the motor snychronization will be lost.</p><p>With <tt>mode</tt> equal to <tt>'off'</tt>, the motor will slowly stop spinning, but using <tt>'brake'</tt> applies real force to the motor to stand still at the current position, just like a real brake.</p><p>Using the active brake (e.g. <tt>StopMotor(MOTOR_A, 'brake')</tt>) can be very power consuming, so watch your battery level when using this functionality for long periods of time.</p><h2>Limitations:<a name="13"></a></h2><p>When working with a motor object that contains multiple motors (e.g. created by <tt>NXTMotor('BC')</tt>), stopping only one motor (in this case with e.g. <tt>StopMotor(MOTOR_B, 'off')</tt>) can lead to unexpected behavior. When working with synchronized motors, always stop those motors together. It's generally recommended to use the motor object's method <tt>Stop</tt> if possible.</p><h2>Example<a name="15"></a></h2><pre class="codeinput"> <span class="comment">% regular stop</span> … … 24 24 m1.Stop(); 25 25 m2.Stop(); 26 </pre><h2>See also<a name="19"></a></h2><p> NXTMotor, Stop, NXT_SetOutputState, MOTOR_A, MOTOR_B, MOTOR_C</p><h2>Signature<a name="21"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/08/24</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>27 </p></div><!--26 </pre><h2>See also<a name="19"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="Stop.html">Stop</a>, <a href="NXT_SetOutputState.html">NXT_SetOutputState</a>, <a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_B.html">MOTOR_B</a>, <a href="MOTOR_C.html">MOTOR_C</a>, </p><h2>Signature<a name="21"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2009/08/24</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 27 Published with wg_publish; V1.0<br></p></div><!-- 28 28 ##### SOURCE BEGIN ##### 29 29 %% StopMotor -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/SwitchLamp.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>SwitchLamp</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_SwitchLamp">9 --><title>SwitchLamp</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_SwitchLamp"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>SwitchLamp</h1><!--introduction--><p>Switches the LEGO lamp on or off (has to be connected to a motor port)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Examples</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>SwitchLamp(port, mode)</tt></p><p><tt>SwitchLamp(port, mode, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>SwitchLamp(port, mode)</tt> turns the LEGO lamp on or off. The given <tt>port</tt> number specifies the used motor port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>MOTOR_A</tt> , <tt>MOTOR_B</tt> and <tt>MOTOR_C</tt> analog to the labeling on the NXT Brick. The value <tt>mode</tt> supports two modes <tt>'on'</tt> and <tt>'off'</tt> to turn the lamp on and off.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>This function simply sets power 100 to the specified motor port to turn on the lamp, or sets power 0 to turn it off. Note that dimming is not possible, even a power of just 1 will be enough to switch the lamp to full brightness (after a short while).</p><p>A <tt>StopMotor</tt> command with parameter <tt>'off'</tt> will also turn off the lamp, but it is recommended to use this function when working with lamps for better readability.</p><h2>Examples<a name="10"></a></h2><pre class="codeinput"> SwitchLamp(MOTOR_B, <span class="string">'on'</span>); 12 12 </pre><pre class="codeinput"> SwitchLamp(MOTOR_A, <span class="string">'off'</span>); 13 </pre><h2>See also<a name="13"></a></h2><p> NXTMotor, StopMotor, MOTOR_A, MOTOR_B, MOTOR_C</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="13"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="StopMotor.html">StopMotor</a>, <a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_B.html">MOTOR_B</a>, <a href="MOTOR_C.html">MOTOR_C</a>, </p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% SwitchLamp -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/USGetSnapshotResults.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>USGetSnapshotResults</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_USGetSnapshotResults">9 --><title>USGetSnapshotResults</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_USGetSnapshotResults"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>USGetSnapshotResults</h1><!--introduction--><p>Retrieves up to eight echos (distances) stored inside the US sensor</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#13">Example</a></li><li><a href="#16">See also</a></li><li><a href="#18">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>echos = USGetSnapshotResults(port)</tt></p><p><tt>echos = USGetSnapshotResults(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p><tt>echos = USGetSnapshotResults(port)</tt> retrieves the echos originating from the ping that was sent out with <tt>USMakeSnapshot(port)</tt> for the ultrasonic sensor connected to <tt>port</tt>. In order for this to work, the sensor must have been opened in snapshot mode using <tt>OpenUltrasonic(port, 'snapshot')</tt>.</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p>The return-vector <tt>echos</tt> always contains exactly 8 readings for up to 8 echos that were recorded from one single signal. Depending on the structure and reflections, this can only be one valid echo, or a lot of interference. The values are distances, just as you'd expect from <tt>GetUltrasonic</tt>. The values are sorted in order of appearance, so they should also be sorted with increasing distances.</p><p>It is not known how exactly the measurements are to be interpreted!</p><p>Please make sure that after calling <tt>USGetSnapshotResults</tt>, there is a little time period for the sound waves to travel, to be reflected, and be recorded by the sensor. You can estimate this using the speed of sound and the maximum distance you expect to measure.</p><p><b>Note:</b> When the US sensor is opened in snapshot mode, the function <tt>GetUltrasonic</tt> does not work correctly!</p><h2>Example<a name="13"></a></h2><pre class="codeinput"> port = SENSOR_4; … … 18 18 echos = USGetSnapshotResults(port); 19 19 CloseSensor(SENSOR_4); 20 </pre><p> You should also try the file Example_4_NextGenerationUltrasound.m from the demos-folder</p><h2>See also<a name="16"></a></h2><p>OpenUltrasonic, GetUltrasonic, USMakeSnapshot, CloseSensor</p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/08</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>21 </p></div><!--20 </pre><p><a href="You should also try the file Example_4_NextGenerationUltrasound.html">You should also try the file Example_4_NextGenerationUltrasound</a>, <a href="m from the demos-folder.html">m from the demos-folder</a>, </p><h2>See also<a name="16"></a></h2><p>OpenUltrasonic, GetUltrasonic, USMakeSnapshot, CloseSensor</p><h2>Signature<a name="18"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/08</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 21 Published with wg_publish; V1.0<br></p></div><!-- 22 22 ##### SOURCE BEGIN ##### 23 23 %% USGetSnapshotResults -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/USMakeSnapshot.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>USMakeSnapshot</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_USMakeSnapshot">9 --><title>USMakeSnapshot</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_USMakeSnapshot"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>USMakeSnapshot</h1><!--introduction--><p>Causes the ultrasonic sensor to send one snapshot ("ping") and record the echos</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#5">Description</a></li><li><a href="#10">Example</a></li><li><a href="#13">See also</a></li><li><a href="#15">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>USMakeSnapshot(port)</tt></p><p><tt>USMakeSnapshot(port, handle)</tt></p><h2>Description<a name="5"></a></h2><p>Call <tt>USMakeSnapshot(port)</tt> to make the specific ultrasonic sensor connected to <tt>port</tt> send out one single signal (called "ping"). In contrast to the US sensor's continous mode (that is invoked by a normal <tt>OpenUltrasonic</tt> without the <tt>'snapshot'</tt> parameter), the sensor will only send out ultrasonic signals when this function is called. Up to 8 multiple echos will be recorded, and the according distances stored in the sensor's internal memory. Use <tt>USGetSnapshotResults</tt> to retrieve those 8 readings in one step!</p><p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one).</p><p><b>Note:</b> When the US sensor is opened in snapshot mode, the function <tt>GetUltrasonic</tt> does not work correctly!</p><h2>Example<a name="10"></a></h2><pre class="codeinput"> port = SENSOR_4; … … 18 18 echos = USGetSnapshotResults(port); 19 19 CloseSensor(SENSOR_4); 20 </pre><p> You should also try the file Example_4_NextGenerationUltrasound.m from the demos-folder</p><h2>See also<a name="13"></a></h2><p>OpenUltrasonic, GetUltrasonic, USGetSnapshotResults, CloseSensor</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/08</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>21 </p></div><!--20 </pre><p><a href="You should also try the file Example_4_NextGenerationUltrasound.html">You should also try the file Example_4_NextGenerationUltrasound</a>, <a href="m from the demos-folder.html">m from the demos-folder</a>, </p><h2>See also<a name="13"></a></h2><p>OpenUltrasonic, GetUltrasonic, USGetSnapshotResults, CloseSensor</p><h2>Signature<a name="15"></a></h2><div><ul><li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS)</li><li><b>Date:</b> 2008/01/08</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 21 Published with wg_publish; V1.0<br></p></div><!-- 22 22 ##### SOURCE BEGIN ##### 23 23 %% USMakeSnapshot -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/WaitFor.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>WaitFor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_WaitFor">9 --><title>WaitFor</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_WaitFor"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>WaitFor</h1><!--introduction--><p>Wait for motor(s) to stop (busy waiting)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#6">Description</a></li><li><a href="#13">Examples:</a></li><li><a href="#17">See also</a></li><li><a href="#20">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>OBJ.WaitFor</tt> <tt>TIMEDOUT = OBJ.WaitFor(TIMEOUT)</tt></p><p><tt>OBJ.WaitFor(HANDLE)</tt> <tt>TIMEDOUT = OBJ.WaitFor(TIMEOUT, HANDLE)</tt></p><h2>Description<a name="6"></a></h2><p><tt>OBJ.WaitFor</tt> waits for motor specified by <tt>OBJ</tt> to stop. We do this by reading the motor state from the NXT brick repeatedly until controlled movement is finished. If the motor is set to run infinitely, the method returns immediately and displays a warning.</p><p><tt>TIMEDOUT = OBJ.WaitFor(TIMEOUT)</tt> does the same as described above but has an additional timeout <tt>TIMEOUT</tt> (given in seconds). After this time the function stops waiting and returns <tt>true</tt>. Otherwise it returns <tt>false</tt>. This functionality is useful to avoid that your robot (and your program) get stuck in case the motor should somehow get stalled (e.g.by driving against a wall).</p><p>Use <tt>HANDLE</tt> (optional) to identify the connection to use for this command.</p><p><b>Note:</b></p><p>If you specify <tt>TIMEOUT</tt> and the motor is not able to finish its current movement command in time (maybe because the motor is blocked?), waiting will be aborted. The motor is probably still busy in this case, so you have to make sure it is ready to accept commands before using it again (i.e. by calling <tt>.Stop()</tt>).</p><h2>Examples:<a name="13"></a></h2><pre class="codeinput"> <span class="comment">% If a |SendToNXT| command is immediately followed by a |Stop|</span> … … 35 35 <span class="keyword">end</span><span class="comment">%if</span> 36 36 <span class="comment">% now we can send new motor commands again...</span> 37 </pre><h2>See also<a name="17"></a></h2><p> NXTMotor, ReadFromNXT, SendToNXT, Stop, StopMotor</p><h2>Signature<a name="20"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>38 </p></div><!--37 </pre><h2>See also<a name="17"></a></h2><p><a href="NXTMotor.html">NXTMotor</a>, <a href="ReadFromNXT.html">ReadFromNXT</a>, <a href="SendToNXT.html">SendToNXT</a>, <a href="Stop.html">Stop</a>, <a href="StopMotor.html">StopMotor</a>, </p><h2>Signature<a name="20"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 38 Published with wg_publish; V1.0<br></p></div><!-- 39 39 ##### SOURCE BEGIN ##### 40 40 %% WaitFor -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/checkStatusByte.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>checkStatusByte</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_checkStatusByte">9 --><title>checkStatusByte</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_checkStatusByte"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>checkStatusByte</h1><!--introduction--><p>Interpretes the status byte of a return package, returns error message</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#6">Example</a></li><li><a href="#8">See also</a></li><li><a href="#10">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>[flag err_message] = checkStatusByte(response)</tt></p><h2>Description<a name="4"></a></h2><p><tt>[flag err_message] = checkStatusByte(response)</tt> interpretes the <tt>response</tt> byte (not hexadecimal). The return value <tt>flag</tt> indicates wether an error has occured (<tt>true</tt> = error, <tt>false</tt> = success). The string value <tt>err_message</tt> contains the error message (or '' in case of success).</p><h2>Example<a name="6"></a></h2><pre class="codeinput"> [status SleepTimeLimit] = NXT_SendKeepAlive(<span class="string">'reply'</span>); 12 12 [err errmsg] = checkStatusByte(status); 13 </pre><h2>See also<a name="8"></a></h2><p> COM_CollectPacket, NXT_LSGetStatus</p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>14 </p></div><!--13 </pre><h2>See also<a name="8"></a></h2><p><a href="COM_CollectPacket.html">COM_CollectPacket</a>, <a href="NXT_LSGetStatus.html">NXT_LSGetStatus</a>, </p><h2>Signature<a name="10"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 14 Published with wg_publish; V1.0<br></p></div><!-- 15 15 ##### SOURCE BEGIN ##### 16 16 %% checkStatusByte -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/display.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>display</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_display">9 --><title>display</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_display"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 </head><body><div class="content"><h1>display</h1><!--introduction--><p> Display method for NXTMotor objects.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Syntax</a></li><li><a href="#2">Description</a></li><li><a href="#5">See also</a></li><li><a href="#8">Signature</a></li></ul></div><h2>Syntax<a name="1"></a></h2><pre>display( obj )</pre><h2>Description<a name="2"></a></h2><p><tt>DISPLAY(OBJ)</tt> displays information pertaining to the NXTMotor object <tt>OBJ</tt>.</p><h2>See also<a name="5"></a></h2><p>NXTMotor</p><h2>Signature<a name="8"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>12 </p></div><!--11 </head><body><div class="content"><h1>display</h1><!--introduction--><p><a href="Display method for NXTMotor objects.html">Display method for NXTMotor objects</a>, </p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Syntax</a></li><li><a href="#2">Description</a></li><li><a href="#5">See also</a></li><li><a href="#8">Signature</a></li></ul></div><h2>Syntax<a name="1"></a></h2><pre>display( obj )</pre><h2>Description<a name="2"></a></h2><p><tt>DISPLAY(OBJ)</tt> displays information pertaining to the NXTMotor object <tt>OBJ</tt>.</p><h2>See also<a name="5"></a></h2><p>NXTMotor</p><h2>Signature<a name="8"></a></h2><div><ul><li><b>Author:</b> Aulis Telle, Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2009/07/20</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 12 Published with wg_publish; V1.0<br></p></div><!-- 13 13 ##### SOURCE BEGIN ##### 14 14 %% display -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/readFromIniFile.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>readFromIniFile</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_readFromIniFile">9 --><title>readFromIniFile</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_readFromIniFile"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>readFromIniFile</h1><!--introduction--><p>Reads parameters from a configuration file (usually *.ini)</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#4">Description</a></li><li><a href="#11">Examples:</a></li><li><a href="#17">See also</a></li><li><a href="#20">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>ret = readFromIniFile(AppName, KeyName, filename)</tt></p><h2>Description<a name="4"></a></h2><p>ret=readFromIniFile(AppName, KeyName, filename)</p><p>This function works like GetPrivateProfileString() from the Windows-API that is well known for reading ini-file data. The parameters are:</p><p>AppName = Section name of the type [xxxx] KeyName = Key name separated by an equal to sign, of the type abc = 123 filename = ini file name to be used</p><p>ret = string (!) value of the key found, empty ('') if key was not found. Since it's a string, you have to convert to integers / floats on your own.</p><p>Note that AppName and KeyName are NOT case sensitive, and that whitespace between '=' and the value will be ignored (removed).</p><p>If the key or the AppName is not found, or if the inifile does not exist or could not be opened, '' will be returned (this will also be returned when the key is empty).</p><h2>Examples:<a name="11"></a></h2><pre class="codeinput"> <span class="comment">%a sample ini file (sample.ini) may have entries:</span> … … 20 20 </pre><pre class="codeinput"> readFromIniFile(<span class="string">'ZZZ'</span>,<span class="string">'abc'</span>, <span class="string">'sample.ini'</span>) <span class="comment">% will return '890'</span> 21 21 </pre><pre class="codeinput"> readFromIniFile(<span class="string">'XYZ'</span>,<span class="string">'def'</span>, <span class="string">'sample.ini'</span>) <span class="comment">% will return '7'</span> 22 </pre><h2>See also<a name="17"></a></h2><h2>Signature<a name="20"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2008/01/08</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 23 </p></div><!--22 23 Published with wg_publish; V1.0<br></p></div><!-- 24 24 ##### SOURCE BEGIN ##### 25 25 %% readFromIniFile -
branches/livecd/RWTHMindstormsNXT/doc/functions/help/textOut.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>textOut</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="script_textOut">9 --><title>textOut</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="script_textOut"> 10 10 <link type="text/css" rel="stylesheet" href="../../style.css"> 11 11 </head><body><div class="content"><h1>textOut</h1><!--introduction--><p>Wrapper for fprintf() which can optionally write screen output to a logfile</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#2">Syntax</a></li><li><a href="#6">Description</a></li><li><a href="#15">Examples</a></li><li><a href="#23">See also</a></li><li><a href="#25">Signature</a></li></ul></div><h2>Syntax<a name="2"></a></h2><p><tt>textOut(strMsg)</tt></p><p><tt>textOut(strMsg, 'screenonly')</tt></p><p><tt>textOut(strMsg, 'logonly')</tt></p><h2>Description<a name="6"></a></h2><p><tt>textOut(strMsg)</tt> will write to screen (command window) AND logfile, if global logging is enabled.</p><p><tt>textOut(strMsg, 'screenonly')</tt> writes to screen (command window) only.</p><p><tt>textOut(strMsg, 'logonly')</tt> writes to logfile only (global logging must be enabled). If logging is disabled or somehow failes, the message will not be logged or displayed at all...</p><p><b>Note:</b></p><p>To enable logging (to file), set the global var <tt>EnableLogging</tt> to <tt>true</tt> and set <tt>Logfilename</tt> to a valid filename. This function distinguishes between Windows and Linux systems to use proper linebreaks. The global variable <tt>DisableScreenOut</tt> is an on/off switch for the complete textOut()-messages that would appear on the command window. Default setting is <tt>false</tt>, i.e. there will be no output.</p><p>Recommended usage is together with sprintf(), in order to add linebreaks for example.</p><h2>Examples<a name="15"></a></h2><pre class="codeinput"> textOut(<span class="string">'This is a message\n'</span>); … … 25 25 textOut(sprintf([<span class="string">'If logging is enabled, this goes to the logfile, '</span>, <span class="keyword">...</span> 26 26 <span class="string">'if not, this goes nowhere\n'</span>])); 27 </pre><h2>See also<a name="23"></a></h2><p> DebugMode, isdebug (private)</p><h2>Signature<a name="25"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br>28 </p></div><!--27 </pre><h2>See also<a name="23"></a></h2><p><a href="DebugMode.html">DebugMode</a>, <a href="isdebug (private).html">isdebug (private)</a>, </p><h2>Signature<a name="25"></a></h2><div><ul><li><b>Author:</b> Linus Atorf (see AUTHORS)</li><li><b>Date:</b> 2007/10/15</li><li><b>Copyright:</b> 2007-2009, RWTH Aachen University</li></ul></div><p class="footer"><br> 28 Published with wg_publish; V1.0<br></p></div><!-- 29 29 ##### SOURCE BEGIN ##### 30 30 %% textOut -
branches/livecd/RWTHMindstormsNXT/doc/programming/motor_control.html
r823 r840 7 7 This HTML is auto-generated from an M-file. 8 8 To make changes, update the M-file and republish this document. 9 --><title>Controlling NXT motors</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-1 0-07"><meta name="m-file" content="motor_control">9 --><title>Controlling NXT motors</title><meta name="generator" content="MATLAB 7.9"><meta name="date" content="2009-11-27"><meta name="m-file" content="motor_control"> 10 10 <link type="text/css" rel="stylesheet" href="../style.css"> 11 11 </head><body><div class="content"><h1>Controlling NXT motors</h1><!--introduction--><p>Being able to control the NXT motors is crucial for most robots. Only very few models work without moving parts. So read on to learn all you need about the class <tt>NXTMotor</tt>.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Getting ready</a></li><li><a href="#3">The basics</a></li><li><a href="#8">Constructing objects and setting properties</a></li><li><a href="#11">Precise moves</a></li><li><a href="#17">Different braking modes</a></li><li><a href="#18">Speed regulation and smooth start</a></li><li><a href="#19">Using two motors</a></li><li><a href="#24">Driving bots the easy way</a></li><li><a href="#28">Reading motor positions</a></li><li><a href="#31">Full example</a></li><li><a href="#32">Limitations of NXTMotor</a></li><li><a href="#36">For experts: DirectMotorCommand</a></li></ul></div><h2>Getting ready<a name="1"></a></h2><p>If you want to execute the examples from this tutorial directly in the command window, I recommend this little sequence of commands to establish a connection to your NXT:</p><pre class="codeinput">COM_CloseNXT <span class="string">all</span> … … 24 24 </pre><p>As said before: <tt>mB1</tt> and <tt>mB2</tt> do exactly the same, so use whichever way you prefer. To inspect motor objects on the command line, just type their name:</p><pre class="codeinput">mB1 25 25 mB2 26 </pre><h2>Precise moves<a name="11"></a></h2><p>Knowing how we control the motor's speed by setting a certain value to |Power|is not enough in most cases. Once could try to move the motor a certain distance by using something like this:</p><pre class="codeinput">mA = NXTMotor(<span class="string">'A'</span>, <span class="string">'Power'</span>, 50);26 </pre><h2>Precise moves<a name="11"></a></h2><p>Knowing how we control the motor's speed by setting a certain value to <tt>Power</tt> is not enough in most cases. One could try to move the motor a certain distance by using something like this:</p><pre class="codeinput">mA = NXTMotor(<span class="string">'A'</span>, <span class="string">'Power'</span>, 50); 27 27 mA.SendToNXT(); 28 28 pause(3); <span class="comment">% wait exactly 3 seconds</span> … … 30 30 </pre><p>Using this technique we get the motor running 3 seconds, but due to several influences (for example Bluetooth lag or subtle differences in NXT motors) this won't lead to the same distance travelled by the motor. Also we can't manage different loads on the motors. This is why we have to specify the distance the motor should turn in degrees. The according property is called <tt>TachoLimit</tt>.</p><pre class="codeinput">mA.TachoLimit = 360; 31 31 mA.SendToNXT(); 32 </pre><p>Now the motor will make exactly 1 whole turn and then stop at about 360 degrees (accurate to +/- 1 degree atmost cases). It is very important to understand that the motor does this movement "on its own", while MATLAB can execute the next command right away. If we say:</p><pre class="codeinput">mB = NXTMotor(<span class="string">'B'</span>, <span class="string">'Power'</span>, 50, <span class="string">'TachoLimit'</span>, 1000);32 </pre><p>Now the motor will make exactly 1 whole turn and then stop at about 360 degrees (accurate to +/- 1 degree in most cases). It is very important to understand that the motor does this movement "on its own", while MATLAB can execute the next command right away. If we say:</p><pre class="codeinput">mB = NXTMotor(<span class="string">'B'</span>, <span class="string">'Power'</span>, 50, <span class="string">'TachoLimit'</span>, 1000); 33 33 mB.SendToNXT(); 34 34 NXT_PlayTone(440, 500); … … 43 43 <span class="comment">% This example is wrong.</span> 44 44 <span class="comment">% We have to use a .WaitFor between the two .SendToNXT()</span> 45 </pre><p>To switch back to unlimited movement, just set <tt>TachoLimit</tt> back to 0.</p><h2>Different braking modes<a name="17"></a></h2><p>So setting a value to <tt>TachoLimit</tt> specifies the angle the motor should spin to, and by the sign of <tt>Power</tt> we can decide the turning direction. We still have some more options to control <i>how</i> the motor should brake. The property is called <tt>ActionAtTachoLimit</tt>. Quoting possible parameters from the documentation of <tt>NXTMotor</tt>:</p><div><ul><li>In <tt>'Coast'</tt> mode, the motor(s) will simply be turned off when the|TachoLimit| is reached, leading to free movement until slowly stopping (called coasting). The <tt>TachoLimit</tt> won't be met, the motor(s) move way too far (overshooting), depending on their angular momentum.</li><li>Use <tt>'Brake'</tt> mode (default) to let the motor(s) automatically slow down nice and smoothly just before the <tt>TachoLimit</tt>. This leads to a very high precision, usually the <tt>TachoLimit</tt> >is met within +/- 1 degree (depending on the motor load and speed of course). After this braking, power to the motor(s) is turned off when they are at rest.</li><li><tt>'Holdbrake'</tt> is similar to <tt>'Brake'</tt>, but in this case the active brake of the motors stays enabled (careful, this consumes a lot of battery power), causing the motor(s) to actively keep holding their position.</li></ul></div><h2>Speed regulation and smooth start<a name="18"></a></h2><p>There are two more options left we'll shortly discuss here. For further details you should consider the documentation of <tt>NXTMotor</tt>.</p><div><ul><li><tt>SpeedRegulation</tt> - this property is set to <tt>true</tt> by default, but you should carefully evaluate wether you need it or not for every motor object. It basically tries to keep your motor running at a constant speed, no matter how much load you put on it. If a motor has heavy lifting to do, the Firmware will internally increase the power value (if possible) to keep the motor running fast enough. While this is a nice thing to have, be careful: The torque of your motor will be dynamically adjusted. Imagine you've got a robotic arm with a limited area of operation and a sensitive gearing. If you enable speed regulation and somehow your arm get's stuck (for example by a programming error of yours) or moves too far, the Firmware will increase the power value to overcome the obstacle. This behavior could destroy your gears or the arm. Sometimes it's desirable to have a constant torque. In that case, better deactivate speed regulation. Another thing to mention: With low speeds, speed regulation sometimes achieves the opposite of what you want: the motor keeps cogging or stuttering. In these cases, speed regulation should also be turned off.</li><li><tt>SmoothStart</tt> - enable this if you want your motor(s) to accelerate softly. Desirable especially for driving robots so that their wheels won't slip when they start driving. The motor will increase its power value in the beginning of movement stepwise until the full speed is reached. This option does only work when a <tt>TachoLimit > 0</tt> is set. It doesn't work with <tt>ActionAtTachoLimit = 'Coast'</tt> either.</li></ul></div><h2>Using two motors<a name="19"></a></h2><p>Until now we've always talked about motor objects controlling one single motor. You could create two of these objects to start a driving robot (where the wheels are attached to ports B and C):</p><pre class="codeinput">mB = NXTMotor(<span class="string">'B'</span>, <span class="string">'Power'</span>, 50);45 </pre><p>To switch back to unlimited movement, just set <tt>TachoLimit</tt> back to 0.</p><h2>Different braking modes<a name="17"></a></h2><p>So setting a value to <tt>TachoLimit</tt> specifies the angle the motor should spin to, and by the sign of <tt>Power</tt> we can decide the turning direction. We still have some more options to control <i>how</i> the motor should brake. The property is called <tt>ActionAtTachoLimit</tt>. Quoting possible parameters from the documentation of <tt>NXTMotor</tt>:</p><div><ul><li>In <tt>'Coast'</tt> mode, the motor(s) will simply be turned off when the|TachoLimit| is reached, leading to free movement until slowly stopping (called coasting). The <tt>TachoLimit</tt> won't be met, the motor(s) move way too far (overshooting), depending on their angular momentum.</li><li>Use <tt>'Brake'</tt> mode (default) to let the motor(s) automatically slow down nice and smoothly just before the <tt>TachoLimit</tt>. This leads to a very high precision, usually the <tt>TachoLimit</tt> is met within +/- 1 degree (depending on the motor load and speed of course). After this braking, power to the motor(s) is turned off when they are at rest.</li><li><tt>'Holdbrake'</tt> is similar to <tt>'Brake'</tt>, but in this case the active brake of the motors stays enabled (careful, this consumes a lot of battery power), causing the motor(s) to actively keep holding their position.</li></ul></div><h2>Speed regulation and smooth start<a name="18"></a></h2><p>There are two more options left we'll shortly discuss here. For further details you should consider the documentation of <tt>NXTMotor</tt>.</p><div><ul><li><tt>SpeedRegulation</tt> - this property is set to <tt>true</tt> by default, but you should carefully evaluate wether you need it or not for every motor object. It basically tries to keep your motor running at a constant speed, no matter how much load you put on it. If a motor has heavy lifting to do, the Firmware will internally increase the power value (if possible) to keep the motor running fast enough. While this is a nice thing to have, be careful: The torque of your motor will be dynamically adjusted. Imagine you've got a robotic arm with a limited area of operation and a sensitive gearing. If you enable speed regulation and somehow your arm get's stuck (for example by a programming error of yours) or moves too far, the Firmware will increase the power value to overcome the obstacle. This behavior could destroy your gears or the arm. Sometimes it's desirable to have a constant torque. In that case, better deactivate speed regulation. Another thing to mention: With low speeds, speed regulation sometimes achieves the opposite of what you want: the motor keeps cogging or stuttering. In these cases, speed regulation should also be turned off.</li><li><tt>SmoothStart</tt> - enable this if you want your motor(s) to accelerate softly. Desirable especially for driving robots so that their wheels won't slip when they start driving. The motor will increase its power value in the beginning of movement stepwise until the full speed is reached. This option does only work when a <tt>TachoLimit > 0</tt> is set. It doesn't work with <tt>ActionAtTachoLimit = 'Coast'</tt> either.</li></ul></div><h2>Using two motors<a name="19"></a></h2><p>Until now we've always talked about motor objects controlling one single motor. You could create two of these objects to start a driving robot (where the wheels are attached to ports B and C):</p><pre class="codeinput">mB = NXTMotor(<span class="string">'B'</span>, <span class="string">'Power'</span>, 50); 46 46 mC = NXTMotor(<span class="string">'C'</span>, <span class="string">'Power'</span>, 50); 47 47 mB.SendToNXT(); … … 311 311 %% Precise moves 312 312 % Knowing how we control the motor's speed by setting a certain value to 313 % |Power| is not enough in most cases. Once could try to move the motor a313 % |Power| is not enough in most cases. One could try to move the motor a 314 314 % certain distance by using something like this: 315 315 … … 332 332 %% 333 333 % Now the motor will make exactly 1 whole turn and then stop at about 360 334 % degrees (accurate to +/- 1 degree atmost cases). It is very important to334 % degrees (accurate to +/- 1 degree in most cases). It is very important to 335 335 % understand that the motor does this movement "on its own", while MATLAB 336 336 % can execute the next command right away. If we say: … … 390 390 % * Use |'Brake'| mode (default) to let the motor(s) automatically 391 391 % slow down nice and smoothly just before the |TachoLimit|. This leads 392 % to a very high precision, usually the |TachoLimit| >is met within +/- 1392 % to a very high precision, usually the |TachoLimit| is met within +/- 1 393 393 % degree (depending on the motor load and speed of course). After this 394 394 % braking, power to the motor(s) is turned off when they are at
