Changeset 282

Show
Ignore:
Timestamp:
09/22/08 16:39:39 (5 years ago)
Author:
telle
Message:

merge comment format with atorf/RWTHMindstormsNXT version

Location:
branches/telle/RWTHMindstormsNXT-Lejos
Files:
100 modified

Legend:

Unmodified
Added
Removed
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_CloseNXT.m

    r247 r282  
    33% 
    44% Syntax 
    5 %   COM_CloseNXT(handle) 
    6 % 
    7 %   COM_CloseNXT('all') 
    8 % 
    9 %   COM_CloseNXT('all', inifilename) 
     5%   |COM_CloseNXT(handle)| 
     6% 
     7%   |COM_CloseNXT('all')| 
     8% 
     9%   |COM_CloseNXT('all', inifilename)| 
    1010% 
    1111% 
     
    1414%   occupied by the handle) by calling this method. After the clean up 
    1515%   invoked by this call, an NXT brick can be accessed and used again (by 
    16 %   COM_OpenNXT or COM_OpenNXTEx. 
    17 % 
    18 %   COM_CloseNXT(handle) will close and erase the specified device. 
    19 %   handle has to be a valid handle struct created by either 
    20 %   COM_OpenNXT or COM_OpenNXTEx. 
    21 % 
    22 %   COM_CloseNXT('all') will close and erase all existing NXT devices 
     16%   |COM_OpenNXT| or |COM_OpenNXTEx|. 
     17% 
     18%   |COM_CloseNXT(handle)| will close and erase the specified device. 
     19%   |handle| has to be a valid handle struct created by either 
     20%   |COM_OpenNXT| or |COM_OpenNXTEx|. 
     21% 
     22%   |COM_CloseNXT('all')| will close and erase all existing NXT devices 
    2323%   from memory (as long as the toolbox could keep track of them). All USB 
    2424%   handles will be destroyed, all open serial ports (for Bluetooth 
     
    2626%   program to create a "fresh start" and a well-defined starting 
    2727%   environment. 
    28 %   Please note that a clear all command can cause this function to fail 
     28%   Please note that a |clear all| command can cause this function to fail 
    2929%   (in such a way, that not all open USB devices can be closed, since all 
    3030%   information about them has be cleare from MATLAB's memory). If this 
    3131%   happens, an NXT device might appear to be busy and cannot be used. 
    3232%   Usually rebooting the NXT helps, if not try to restart MATLAB as well. 
    33 %   So be careful with using clear all before COM_CloseNXT('all').  
    34 % 
    35 %   COM_CloseNXT('all', inifilename) will do the same as above, but 
     33%   So be careful with using |clear all| before |COM_CloseNXT('all').  
     34% 
     35%   |COM_CloseNXT('all', inifilename)| will do the same as above, but 
    3636%   instead of closing all open serial ports, only the COM-Port specified 
    37 %   in inifilename will be used (a valid Bluetooth configuration file can be  
    38 %   created by the function COM_MakeBTConfigFile).  
     37%   in |inifilename| will be used (a valid Bluetooth configuration file can be  
     38%   created by the function |COM_MakeBTConfigFile|).  
    3939%   This syntax helps to avoid interference with other serial ports that might 
    4040%   be used by other (MATLAB) programs at the same time. Note that still all open 
     
    4343% 
    4444% Limitations 
    45 %   If you call COM_CloseNXT('all') after a clear all command has been 
     45%   If you call |COM_CloseNXT('all')| after a |clear all| command has been 
    4646%   issued, the function will not be able to close all remaining open USB 
    4747%   handles, since they have been cleared out of memory. This is a problem 
    4848%   on Linux systems. You will not be able to use the NXT device without 
    4949%   rebooting it. 
    50 %   Solution: Either use only clear in your programs, or you use the 
    51 %   COM_CloseNXT('all') statement before clear all. 
     50%   Solution: Either use only |clear| in your programs, or you use the 
     51%   |COM_CloseNXT('all')| statement before |clear all|. 
    5252%   The best way however is to track your handles carefully and close them 
    5353%   manually before exiting whenever possible! 
     
    5555% 
    5656% Example 
    57 %   handle = COM_OpenNXT('bluetooth.ini', check'); 
    58 %   COM_SetDefaultNXT(handle); 
    59 %   NXT_PlayTone(440,10); 
    60 %   COM_CloseNXT(handle); 
     57%+   handle = COM_OpenNXT('bluetooth.ini', check'); 
     58%+   COM_SetDefaultNXT(handle); 
     59%+   NXT_PlayTone(440,10); 
     60%+   COM_CloseNXT(handle); 
    6161% 
    6262% See also: COM_OpenNXT, COM_OpenNXTEx, COM_MakeBTConfigFile, COM_SetDefaultNXT 
     
    6767%   Copyright: 2007-2008, RWTH Aachen University 
    6868% 
     69; 
    6970% 
    7071% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_CollectPacket.m

    r247 r282  
    33% 
    44% Syntax 
    5 %   [type cmd statusbyte content] = COM_CollectPacket(handle) 
    6 % 
    7 %   [type cmd statusbyte content] = COM_CollectPacket(handle, 'dontcheck') 
     5%   |[type cmd statusbyte content] = COM_CollectPacket(handle)| 
     6% 
     7%   |[type cmd statusbyte content] = COM_CollectPacket(handle, 'dontcheck')| 
    88% 
    99% Description 
    10 %   [type cmd statusbyte content] = COM_CollectPacket(handle) reads one packet on the communication 
    11 %   channel specified by the handle struct (PC system: handle struct containing e.g. serial 
     10%   |[type cmd statusbyte content] = COM_CollectPacket(handle)| reads one packet on the communication 
     11%   channel specified by the |handle| struct (PC system: handle struct containing e.g. serial 
    1212%   handle, Linux system: handle struct containing file handle). The USB / Bluetooth handle 
    13 %   struct can be obtained by the COM_OpenNXT or COM_GetDefaultNXT  command. The return 
    14 %   value type specifies the telegram type according to the LEGO Mindstorms communication 
    15 %   protcol. The cmd value determines the specific command. status indicates if an error 
    16 %   occured on the NXT brick. The function checkStatusByte is interpreting this information 
    17 %   per default. The content column vector represents the remaining payload of the whole return packet. E.g. it  
     13%   struct can be obtained by the |COM_OpenNXT| or |COM_GetDefaultNXT|  command. The return 
     14%   value |type| specifies the telegram type according to the LEGO Mindstorms communication 
     15%   protcol. The |cmd| value determines the specific command. |status| indicates if an error 
     16%   occured on the NXT brick. The function |checkStatusByte| is interpreting this information 
     17%   per default. The |content| column vector represents the remaining payload of the whole return packet. E.g. it  
    1818%   contains the current battery level in milli volts, that then has to be converted to a valid 
    19 %   integer from its byte representation (i.e. using wordbytes2dec).  
    20 % 
    21 %   [type cmd statusbyte content] = COM_CollectPacket(handle, 'dontcheck') disables the validation 
    22 %   check of the status value by function checkStatusBytes. 
     19%   integer from its byte representation (i.e. using |wordbytes2dec|).  
     20% 
     21%   |[type cmd statusbyte content] = COM_CollectPacket(handle, 'dontcheck')| disables the validation 
     22%   check of the |status| value by function |checkStatusBytes|. 
    2323% 
    2424%               varargin : set to 'dontcheck' if the status byte should not 
     
    3232%   This function uses the specific Bluetooth settings from the ini-file 
    3333%   that was specified when opening the handle. Parameters used here are 
    34 %   SendSendPause and SendReceivePause, which will cause this function 
     34%   |SendSendPause| and |SendReceivePause|, which will cause this function 
    3535%   to wait a certain amount of milliseconds between each consecutive send 
    3636%   or receive operation to avoid packet loss or buffer overflows inside 
     
    3838% 
    3939% Example 
    40 %   COM_MakeBTConfigFile(); 
    41 % 
    42 %   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
    43 % 
    44 %   [type cmd] = name2commandbytes('KEEPALIVE'); 
    45 %   content = [];  % no payload in NXT command KEEPALIVE 
    46 %   packet = COM_CreatePacket(type, cmd, 'reply', content); 
    47 % 
    48 %   COM_SendPacket(packet, handle); 
    49 % 
    50 %   [type cmd statusbyte content] = COM_CollectPacket(handle); 
    51 %   % Now you could check the statusbyte or interpret the content. 
    52 %   % Or maybe check for valid type and cmd before... 
     40%+   COM_MakeBTConfigFile(); 
     41%+ 
     42%+   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
     43%+ 
     44%+   [type cmd] = name2commandbytes('KEEPALIVE'); 
     45%+   content = [];  % no payload in NXT command KEEPALIVE 
     46%+   packet = COM_CreatePacket(type, cmd, 'reply', content);  
     47%+ 
     48%+   COM_SendPacket(packet, handle); 
     49%+ 
     50%+   [type cmd statusbyte content] = COM_CollectPacket(handle);  
     51%+   % Now you could check the statusbyte or interpret the content. 
     52%+   % Or maybe check for valid type and cmd before... 
    5353% 
    5454% See also: COM_CreatePacket, COM_SendPacket, COM_OpenNXT, COM_GetDefaultNXT, 
     
    6060%   Copyright: 2007-2008, RWTH Aachen University 
    6161% 
     62; 
    6263% 
    6364% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_CreatePacket.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   bytes = COM_CreatePacket(CommandType, Command, ReplyMode, ContentBytes) 
     5%   |bytes = COM_CreatePacket(CommandType, Command, ReplyMode, ContentBytes)| 
    66% 
    77% Description 
    8 %   bytes = COM_CreatePacket(CommandType, Command, ReplyMode, ContentBytes) creates a valid 
    9 %   Bluetooth packet conform to the LEGO Mindstorms communication protocol. The CommandType 
     8%   |bytes = COM_CreatePacket(CommandType, Command, ReplyMode, ContentBytes)| creates a valid 
     9%   Bluetooth packet conform to the LEGO Mindstorms communication protocol. The |CommandType| 
    1010%   specifies the telegram type (direct or system command (see the 
    1111%   LEGO Mindstorms communication protocol documentation for more details)). This type is determined 
    12 %   from the function name2commandbytes. The Command specifies the actual command according to 
    13 %   the LEGO Mindstorms communication protocol. By the ReplyMode one can request an 
    14 %   acknowledgement for the packet transmission. The two strings 'reply' and 'dontreply' are 
    15 %   valid. The content byte-array is given by the ContentBytes. 
     12%   from the function |name2commandbytes|. The |Command| specifies the actual command according to 
     13%   the LEGO Mindstorms communication protocol. By the |ReplyMode| one can request an 
     14%   acknowledgement for the packet transmission. The two strings |'reply'| and |'dontreply'| are 
     15%   valid. The content byte-array is given by the |ContentBytes|. 
    1616% 
    17 %   The return value bytes represents the complete Bluetooth packet conform to the LEGO Mindstorms 
     17%   The return value |bytes| represents the complete Bluetooth packet conform to the LEGO Mindstorms 
    1818%   Communication protocol. 
    1919% 
    2020% Note: 
    21 %   The activated ReplyMode should only be used if it is necessary. According to the official 
     21%   The activated |ReplyMode| should only be used if it is necessary. According to the official 
    2222%   LEGO statement "Testing during development has shown that the Bluetooth Serial Port 
    2323%   communication has some disadvantages when it comes to streaming data. ... One problem is a time 
     
    2929% 
    3030% Example 
    31 %   [type cmd] = name2commandbytes('PLAYTONE'); 
    32 %   content(1:2) = dec2wordbytes(frequency, 2); 
    33 %   content(3:4) = dec2wordbytes(duration, 2); 
    34 % 
    35 %   packet = COM_CreatePacket(type, cmd, 'dontreply', content); 
     31%+   [type cmd] = name2commandbytes('PLAYTONE'); 
     32%+   content(1:2) = dec2wordbytes(frequency, 2); 
     33%+   content(3:4) = dec2wordbytes(duration, 2); 
     34%+ 
     35%+   packet = COM_CreatePacket(type, cmd, 'dontreply', content); 
    3636% 
    3737% See also: COM_SendPacket, COM_CollectPacket, name2commandbytes, dec2wordbytes 
     
    4242%   Copyright: 2007-2008, RWTH Aachen University 
    4343% 
     44; 
    4445% 
    4546% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_GetDefaultNXT.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   h = COM_GetDefaultNXT() 
     5%   |h = COM_GetDefaultNXT()| 
    66% 
    77% Description 
    8 %   h = COM_GetDefaultNXT() returns the global default NXT handle h if it was previously  
     8%   |h = COM_GetDefaultNXT()| returns the global default NXT handle |h| if it was previously  
    99%   set. The default global NXT handle is used by all NXT-Functions per default if no other 
    10 %   handle is specified. To set this global handle the function COM_SetDefaultNXT is used. 
     10%   handle is specified. To set this global handle the function |COM_SetDefaultNXT| is used. 
    1111% 
    1212% Example 
    13 %   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
    14 %   COM_SetDefaultNXT(handle); 
    15 %   MyNXT = COM_GetDefaultNXT(); 
    16 %   % now MyNXT and handle refer to the same device 
     13%+   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
     14%+   COM_SetDefaultNXT(handle); 
     15%+   MyNXT = COM_GetDefaultNXT(); 
     16%+   % now MyNXT and handle refer to the same device 
    1717% 
    1818% See also: COM_SetDefaultNXT, COM_OpenNXT, COM_OpenNXTEx 
     
    2323%   Copyright: 2007-2008, RWTH Aachen University 
    2424% 
     25; 
    2526% 
    2627% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_MakeBTConfigFile.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   COM_MakeBTConfigFile() 
     5%   |COM_MakeBTConfigFile()| 
    66% 
    77% Description 
    8 %   COM_MakeBTConfigFile() starts a user guided dialog window to select the output directory, 
     8%   |COM_MakeBTConfigFile()| starts a user guided dialog window to select the output directory, 
    99%   the file name and the Bluetooth paramters like e.g. COM port. 
    1010% 
    1111%   The little program creates a specific Bluetooth configuration file for the current PC system. 
    1212%   Make sure the configuration file is accessible under MATLAB if you try to open a Bluetooth 
    13 %   connection using COM_OpenNXT and the correct file name. 
     13%   connection using |COM_OpenNXT| and the correct file name. 
    1414% 
    1515% Example 
    16 %   COM_MakeBTConfigFile(); 
    17 % 
    18 %   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
     16%+   COM_MakeBTConfigFile(); 
     17%+ 
     18%+   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
    1919% 
    2020% See also: COM_OpenNXT, COM_CloseNXT, COM_OpenNXTEx 
     
    2525%   Copyright: 2007-2008, RWTH Aachen University 
    2626% 
     27; 
    2728% 
    2829% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_OpenNXT.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   handle = COM_OpenNXT() 
     5%   |handle = COM_OpenNXT()| 
    66% 
    7 %   handle = COM_OpenNXT(inifilename, 'check') 
     7%   |handle = COM_OpenNXT(inifilename, 'check')| 
    88% 
    99% Description 
    10 %   handle = COM_OpenNXT() tries to open a connection via USB. The first 
     10%   |handle = COM_OpenNXT()| tries to open a connection via USB. The first 
    1111%   NXT device that is found will be used. Device drivers (Fantom on 
    1212%   Windows, libusb on Linux) have to be already installed for USB to work. 
    1313% 
    14 %   handle = COM_OpenNXT(inifilename, 'check') will search the USB bus 
     14%   |handle = COM_OpenNXT(inifilename, 'check')| will search the USB bus 
    1515%   for NXT devices, just as the syntax without any parameters. If this fails 
    1616%   for some reason (no USB connection to the NXT available, no device drivers 
    1717%   installed, or NXT device is busy), the function will try to establish a  
    1818%   connection via Bluetooth, using the given Bluetooth configuration file 
    19 %   (you can create one easily with COM_MakeBTConfigFile. The optional 
    20 %   paramter 'check' can be omitted, but that is not recommended (as it detects errors with the 
     19%   (you can create one easily with |COM_MakeBTConfigFile|. The optional 
     20%   paramter |'check'| can be omitted, but that is not recommended (as it detects errors with the 
    2121%   Bluetooth connection outside MATLAB right away). For more information 
    22 %   about this 'check'-option, see the documentation on NXT_CloseNXTEx. 
     22%   about this |'check'|-option, see the documentation on |NXT_CloseNXTEx|. 
    2323% 
    2424 
    2525%   Note that this function is the most simple way to get an NXT handle. If 
    2626%   you need a method to access multiple NXTs or more options, see the 
    27 %   advanced function COM_OpenNXTEx. In fact, COM_OpenNXT is just a 
    28 %   convenient wrapper to COM_OpenNXTEx('Any', ...). 
     27%   advanced function |COM_OpenNXTEx|. In fact, |COM_OpenNXT| is just a 
     28%   convenient wrapper to |COM_OpenNXTEx('Any', ...)|. 
    2929% 
    3030% 
    31 % Limitations of COM_CloseNXT 
    32 %   If you call COM_CloseNXT('all') after a clear all command has been 
     31% Limitations of |COM_CloseNXT| 
     32%   If you call |COM_CloseNXT('all')| after a |clear all| command has been 
    3333%   issued, the function will not be able to close all remaining open USB 
    3434%   handles, since they have been cleared out of memory. This is a problem 
    3535%   on Linux systems. You will not be able to use the NXT device without 
    3636%   rebooting it. 
    37 %   Solution: Either use only clear in your programs, or you use the 
    38 %   COM_CloseNXT('all') statement before clear all. 
     37%   Solution: Either use only |clear| in your programs, or you use the 
     38%   |COM_CloseNXT('all')| statement before |clear all|. 
    3939%   The best way however is to track your handles carefully and close them 
    40 %   manually (COM_CloseNXT(handle)) before exiting whenever possible! 
     40%   manually (|COM_CloseNXT(handle)|) before exiting whenever possible! 
    4141% 
    4242% 
    4343% Example 
    44 %   handle = COM_OpenNXT('bluetooth.ini', check'); 
    45 %   COM_SetDefaultNXT(handle); 
    46 %   NXT_PlayTone(440,10); 
    47 %   COM_CloseNXT(handle); 
     44%+   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
     45%+   COM_SetDefaultNXT(handle); 
     46%+   NXT_PlayTone(440,10); 
     47%+   COM_CloseNXT(handle); 
    4848% 
    4949% See also: COM_OpenNXTEx, COM_CloseNXT, COM_MakeBTConfigFile, COM_SetDefaultNXT 
     
    5454%   Copyright: 2007-2008, RWTH Aachen University 
    5555% 
     56; 
    5657% 
    5758% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_OpenNXTEx.m

    r247 r282  
    245245%     handle.IniFilename           = h.IniFilename; 
    246246%     handle.ComPort               = h.ComPort; 
    247 %     handle.BaudRate              = h.BaudRate; 
    248 %     handle.DataBits              = h.DataBits; 
    249 %     handle.Timeout               = h.Timeout; 
     247%     handle.BaudRate                    = h.BaudRate; 
     248%     handle.DataBits                    = h.DataBits; 
     249%     handle.Timeout                     = h.Timeout; 
    250250%  
    251 %     handle.SendSendPause         = h.SendSendPause; 
     251%     handle.SendSendPause               = h.SendSendPause; 
    252252%     handle.SendReceivePause      = h.SendReceivePause; 
    253253%  
    254254%     handle.NXTMAC                = h.NXTMAC; 
    255 %     handle.CreationTime         = h.CreationTime;   
     255%     handle.CreationTime               = h.CreationTime;   
    256256%     handle.Index                 = h.Index; 
    257257     
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_SendPacket.m

    r281 r282  
    33% 
    44% Syntax 
    5 %   COM_SendPacket(Packet, handle) 
     5%   |COM_SendPacket(Packet, handle)| 
    66% 
    77% Description 
    8 %   COM_SendPacket(Packet, handle) sends the given byte-array Packet (column vector), 
    9 %   (which can easily be created by the function COM_CreatePacket) over the USB or Bluetooth 
    10 %   channel specified by the given handle (struct) created by the function COM_OpenNXT or  
    11 %   COM_OpenNXTEx, or obtained from COM_GetDefaultNXT.  
     8%   |COM_SendPacket(Packet, handle)| sends the given byte-array |Packet| (column vector), 
     9%   (which can easily be created by the function |COM_CreatePacket|) over the USB or Bluetooth 
     10%   channel specified by the given |handle| (struct) created by the function |COM_OpenNXT| or  
     11%   |COM_OpenNXTEx|, or obtained from |COM_GetDefaultNXT|.  
    1212% 
    1313% Note 
    1414%   In the case of a Bluetooth connection this function uses the specific settings from the 
    1515%   ini-file that was specified when opening the handle. Parameters used here are 
    16 %   SendSendPause and SendReceivePause, which will cause this function to wait a certain 
     16%   |SendSendPause| and |SendReceivePause|, which will cause this function to wait a certain 
    1717%   amount of milliseconds between each consecutive send or receive operation to avoid packet 
    1818%   loss or buffer overflows inside the blutooth stack. 
    1919% 
    2020% Example 
    21 %   COM_MakeBTConfigFile(); 
    22 % 
    23 %   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
    24 % 
    25 %   [type cmd] = name2commandbytes('KEEPALIVE'); 
    26 %   content = [];  % no payload in NXT command KEEPALIVE 
    27 %   packet = COM_CreatePacket(type, cmd, 'dontreply', content); 
    28 % 
    29 %   COM_SendPacket(packet, bt_handle); 
     21%+   COM_MakeBTConfigFile(); 
     22%+ 
     23%+   handle = COM_OpenNXT('bluetooth.ini', 'check'); 
     24%+ 
     25%+   [type cmd] = name2commandbytes('KEEPALIVE'); 
     26%+   content = [];  % no payload in NXT command KEEPALIVE 
     27%+   packet = COM_CreatePacket(type, cmd, 'dontreply', content);  
     28%+ 
     29%+   COM_SendPacket(packet, bt_handle); 
    3030% 
    3131% See also: COM_CreatePacket, COM_CollectPacket, COM_OpenNXT, COM_GetDefaultNXT, COM_MakeBTConfigFile 
     
    3636%   Copyright: 2007-2008, RWTH Aachen University 
    3737% 
     38; 
    3839% 
    3940% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/COM_SetDefaultNXT.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   COM_SetDefaultNXT(h) 
     5%   |COM_SetDefaultNXT(h)| 
    66% 
    77% Description 
    8 %   COM_SetDefaultNXT(h) sets the given handle h to the global NXT handle, which is used 
     8%   |COM_SetDefaultNXT(h)| sets the given handle |h| to the global NXT handle, which is used 
    99%   by all NXT-Functions per default if no other handle is specified. To 
    1010%   create and open an NXT handle (Bluetooth or USB), the functions 
    11 %   COM_OpenNXT and COM_OpenNXTEx can be used. To retrieve the global default handle 
    12 %   user COM_GetDefaultNXT. 
     11%   |COM_OpenNXT| and |COM_OpenNXTEx| can be used. To retrieve the global default handle 
     12%   user |COM_GetDefaultNXT|. 
    1313% 
    1414% Example 
    15 %   MyNXT = COM_OpenNXT('bluetooth.ini', 'check'); 
    16 %   COM_SetDefaultNXT(MyNXT); 
     15%+   MyNXT = COM_OpenNXT('bluetooth.ini', 'check'); 
     16%+   COM_SetDefaultNXT(MyNXT); 
    1717% 
    1818% See also: COM_GetDefaultNXT, COM_OpenNXT, COM_OpenNXTEx 
     
    2323%   Copyright: 2007-2008, RWTH Aachen University 
    2424% 
     25; 
    2526% 
    2627% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/CloseSensor.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   CloseSensor(port) 
     5%   |CloseSensor(port)| 
    66% 
    77% Description 
    8 %   CloseSensor(port) closes the sensor port opened by the Open... functions. The value port can be 
    9 %   addressed by the symbolic constants SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to 
     8%   |CloseSensor(port)| closes the sensor |port| opened by the |Open...| functions. The value |port| can be 
     9%   addressed by the symbolic constants |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to 
    1010%   the labeling on the NXT Brick. Closing the light sensor deactives the active light 
    1111%   mode (the red light is turned off), closing the Ultrasonic sensor stops sending out ultrasound. 
     
    1313% 
    1414% Examples 
    15 %   OpenLight(SENSOR_3, 'ACTIVE'); 
    16 %   light = GetLight(SENSOR_3); 
    17 %   CloseSensor(SENSOR_3); 
     15%+   OpenLight(SENSOR_3, 'ACTIVE'); 
     16%+   light = GetLight(SENSOR_3); 
     17%+   CloseSensor(SENSOR_3); 
    1818% 
    1919% See also: NXT_SetInputMode, OpenLight, OpenSound, OpenSwitch, OpenUltrasonic, SENSOR_1, SENSOR_2, 
     
    2525%   Copyright: 2007-2008, RWTH Aachen University 
    2626% 
     27; 
    2728% 
    2829% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/DebugMode.m

    r201 r282  
    33 
    44% Syntax 
    5 %   state = DebugMode();  
     5%   |state = DebugMode();|  
    66% 
    7 %   DebugMode(state);  
     7%   |DebugMode(state);|  
    88% 
    99% 
    1010% Description 
    11 %   The function textOut can be used to display text messages inside the command 
     11%   The function |textOut| can be used to display text messages inside the command 
    1212%   window. These messages can optionally be logged to a file (see textOut for 
    1313%   details) or the output can be disable. To turn off those debug messages, the 
    14 %   global variable DisableScreenOut had to be modified in earlier toolbox 
    15 %   versions. Now the function DebugMode provides easier access. 
     14%   global variable |DisableScreenOut| had to be modified in earlier toolbox 
     15%   versions. Now the function |DebugMode| provides easier access. 
    1616% 
    17 %   state = DebugMode(); returns the current debug state, the return value is 
    18 %   either 'on' or 'off'. 
     17%   |state = DebugMode();| returns the current debug state, the return value is 
     18%   either |'on'| or |'off'|. 
    1919% 
    20 %   DebugMode(state); is used to switch between displaying messages and silent 
    21 %   mode. The paramter state has to be 'on' or 'off'. 
     20%   |DebugMode(state);| is used to switch between displaying messages and silent 
     21%   mode. The paramter |state| has to be |'on'| or |'off'|. 
    2222% 
    2323% 
    24 %   Note: If you need a fast alternative to strcmpi(DebugMode(), 'on'), please 
    25 %   consider the private toolbox function isdebug. 
     24%   Note: If you need a fast alternative to |strcmpi(DebugMode(), 'on')|, please 
     25%   consider the private toolbox function |isdebug|. 
    2626% 
    2727% Example 
    28 %  % enable debug messages 
    29 %  DebugMode on 
     28%+  % enable debug messages 
     29%+  DebugMode on 
    3030% 
    31 %  % remember old setting 
    32 %  oldState = DebugMode(); 
    33 %  DebugMode('on'); 
    34 %     % do something with textOut(), it will be displayed! 
    35 %  % restore previous setting 
    36 %  DebugMode(oldState); 
     31%+  % remember old setting  
     32%+  oldState = DebugMode(); 
     33%+  DebugMode('on'); 
     34%+     % do something with textOut(), it will be displayed! 
     35%+  % restore previous setting 
     36%+  DebugMode(oldState); 
    3737% 
    3838% 
     
    4444%   Copyright: 2007-2008, RWTH Aachen University 
    4545% 
     46; 
    4647% 
    4748% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/GetLight.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   light = GetLight(port) 
     5%   |light = GetLight(port)| 
    66% 
    77% Description 
    8 %   light = GetLight(port) returns the current light value light of the NXT light 
    9 %   sensor. The measurement value light represents the normalized (default) sound value (0..1023 / 
    10 %   10 Bit). The normalized value mode is set per default by the function OpenLight. 
    11 %   The given port number specifies the connection port. The value port can be 
    12 %   addressed by the symbolic constants SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to 
     8%   |light = GetLight(port)| returns the current light value |light| of the NXT light 
     9%   sensor. The measurement value |light| represents the normalized (default) sound value (0..1023 / 
     10%   10 Bit). The normalized value mode is set per default by the function |OpenLight|. 
     11%   The given |port| number specifies the connection port. The value |port| can be 
     12%   addressed by the symbolic constants |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to 
    1313%   the labeling on the NXT Brick. 
    1414% 
    15 %   For more complex settings the function NXT_GetInputValues can be used. 
     15%   For more complex settings the function |NXT_GetInputValues| can be used. 
    1616% 
    1717% Examples 
    18 %   OpenLight(SENSOR_1, 'ACTIVE'); 
    19 %   light = GetLight(SENSOR_1); 
    20 %   CloseSensor(SENSOR_1); 
     18%+   OpenLight(SENSOR_1, 'ACTIVE'); 
     19%+   light = GetLight(SENSOR_1); 
     20%+   CloseSensor(SENSOR_1); 
    2121% 
    2222% See also: NXT_GetInputValues, OpenLight, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    2727%   Copyright: 2007-2008, RWTH Aachen University 
    2828% 
     29; 
    2930% 
    3031% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/GetMemoryCount.m

    r201 r282  
    33 
    44% Syntax 
    5 %   memory = GetMemoryCount(port)  
     5%   |memory = GetMemoryCount(port)|  
    66% 
    77% Description 
    8 %   memory = GetMemoryCount(port) gets the internal NXT memory counter (maual mapping replica) 
    9 %   of the given motor port. The value port can be addressed by the symbolic constants 
    10 %   MOTOR_A, MOTOR_B and MOTOR_C analog to the labeling on the NXT Brick. The return value 
    11 %   memory contains the value of the NXT memory counter (maunal mapping replica). 
     8%   |memory = GetMemoryCount(port)| gets the internal NXT memory counter (maual mapping replica) 
     9%   of the given motor |port|. The value |port| can be addressed by the symbolic constants 
     10%   |MOTOR_A|, |MOTOR_B| and |MOTOR_C| analog to the labeling on the NXT Brick. The return value 
     11%   |memory| contains the value of the NXT memory counter (maunal mapping replica). 
    1212% 
    1313% Note: 
     
    1515% 
    1616% Examples 
    17 %   memory = GetMemoryCount(MOTOR_A); 
     17%+   memory = GetMemoryCount(MOTOR_A); 
    1818% 
    1919% See also: SetMemoryCounter, MOTOR_A, MOTOR_B, MOTOR_C 
     
    2424%   Copyright: 2007-2008, RWTH Aachen University 
    2525% 
     26; 
    2627% 
    2728% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/GetMotor.m

    r201 r282  
    33 
    44% Syntax 
    5 %   number = GetMotor()  
     5%   |number = GetMotor()|  
    66% 
    77% Description 
    8 %   number = GetMotor() returns the current motor number set by function SetMotor. The value 
    9 %   number can be 0, 1 or 2. 
     8%   |number = GetMotor()| returns the current motor |number| set by function |SetMotor|. The value 
     9%   |number| can be |0|, |1| or |2|. 
    1010% 
    1111% Example 
    12 %   SetMotor(MOTOR_B); 
    13 %   number = GetMotor(); 
     12%+   SetMotor(MOTOR_B); 
     13%+   number = GetMotor(); 
    1414% 
    1515% See also: SetMotor 
     
    2020%   Copyright: 2007-2008, RWTH Aachen University 
    2121% 
     22; 
    2223% 
    2324% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/GetMotorSettings.m

    r248 r282  
    33 
    44% Syntax 
    5 %   data = GetMotorSettings(port)  
     5%   |data = GetMotorSettings(port)|  
    66% 
    77% Description 
    8 %   data = GetMotorSettings(port) returns the current motor data / settings of the given motor 
    9 %   port. The value port can be addressed by the symbolic constants MOTOR_A , MOTOR_B and 
    10 %   MOTOR_C analog to the labeling on the NXT Brick. The return value data is a struct variable. 
     8%   |data = GetMotorSettings(port)| returns the current motor data / settings of the given motor 
     9%   |port|. The value |port| can be addressed by the symbolic constants |MOTOR_A| , |MOTOR_B| and 
     10%   |MOTOR_C| analog to the labeling on the NXT Brick. The return value |data| is a struct variable. 
    1111%   It contains several motor settings and information. 
    1212% 
    1313% Output: 
    14 %     data.IsRunning         % boolean, true if the motor "does something" 
     14%     |data.IsRunning|         % boolean, true if the motor "does something" 
    1515% 
    16 %     data.Power             % current power 
     16%     |data.Power|             % current power 
    1717% 
    18 %     data.AngleLimit        % current set angle limit, 0 means none set 
     18%     |data.AngleLimit|        % current set angle limit, 0 means none set 
    1919% 
    20 %     data.TurnRatio         % current turn ratio 
     20%     |data.TurnRatio|         % current turn ratio 
    2121% 
    22 %     data.SpeedRegulation   % boolean, speed regulated or not? 
     22%     |data.SpeedRegulation|   % boolean, speed regulated or not? 
    2323% 
    24 %     data.SyncToMotor       % the motor this one is synced to. -1 means not synced 
     24%     |data.SyncToMotor|       % the motor this one is synced to. -1 means not synced 
    2525% 
    26 %     data.TachoCount        % internal, non-resettable rotation-counter (in degrees) 
     26%     |data.TachoCount|        % internal, non-resettable rotation-counter (in degrees) 
    2727% 
    28 %     data.Angle             % current motor position, resettable using, ResetMotorAngle 
     28%     |data.Angle|             % current motor position, resettable using, |ResetMotorAngle| 
    2929% 
    30 %     data.MotorBrake        % boolean, is electronic braking enabled? 
     30%     |data.MotorBrake|        % boolean, is electronic braking enabled? 
    3131% 
    3232% Example 
    33 %   SetMotor(MOTOR_C); 
    34 %       SetPower(67); 
    35 %       SetAngleLimit(240); 
    36 %       SpeedRegulation('on'); 
    37 %   SendMotorSettings(); 
    38 % 
    39 %   WaitForMotor(MOTOR_C); 
    40 % 
    41 %   data = GetMotorSettings(MOTOR_C); 
     33%+   SetMotor(MOTOR_C); 
     34%+      SetPower(67); 
     35%+      SetAngleLimit(240); 
     36%+      SpeedRegulation('on'); 
     37%+   SendMotorSettings(); 
     38%+ 
     39%+   WaitForMotor(MOTOR_C); 
     40%+ 
     41%+   data = GetMotorSettings(MOTOR_C); 
    4242% 
    4343% See also: SendMotorSettings, ResetMotorAngle 
     
    4848%   Copyright: 2007-2008, RWTH Aachen University 
    4949% 
     50; 
    5051% 
    5152% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/GetSound.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   sound = GetSound(port) 
     5%   |sound = GetSound(port)| 
    66% 
    77% Description 
    8 %   sound = GetSound(port) returns the current sound value sound of the NXT sound 
    9 %   sensor. The measurement value sound represents the normalized (default) sound value (0..1023 / 
    10 %   10 Bit). The normalized value mode is set per default by the function OpenSound. 
    11 %   The given port number specifies the connection port. The value port can be 
    12 %   addressed by the symbolic constants SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to 
     8%   |sound = GetSound(port)| returns the current sound value |sound| of the NXT sound 
     9%   sensor. The measurement value |sound| represents the normalized (default) sound value (0..1023 / 
     10%   10 Bit). The normalized value mode is set per default by the function |OpenSound|. 
     11%   The given |port| number specifies the connection port. The value |port| can be 
     12%   addressed by the symbolic constants |SENSOR_1|, |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to 
    1313%   the labeling on the NXT Brick. 
    1414% 
    15 %   For more complex settings the function NXT_GetInputMode can be used. 
     15%   For more complex settings the function |NXT_GetInputMode| can be used. 
    1616% 
    1717% Example 
    18 %   OpenSound(SENSOR_1, 'DB'); 
    19 %   sound = GetSound(SENSOR_1); 
    20 %   CloseSensor(SENSOR_1); 
     18%+   OpenSound(SENSOR_1, 'DB'); 
     19%+   sound = GetSound(SENSOR_1); 
     20%+   CloseSensor(SENSOR_1); 
    2121% 
    2222% See also: NXT_GetInputMode, OpenLight, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    2727%   Copyright: 2007-2008, RWTH Aachen University 
    2828% 
     29; 
    2930% 
    3031% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/GetSwitch.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   switch = GetSwitch(port) 
     5%   |switch = GetSwitch(port)| 
    66% 
    77% Description 
    8 %   switch = GetSwitch(port) returns the current switch value switch of the NXT switch / touch 
    9 %   sensor. The measurement value switch represents the pressing mode of the switch / touch 
    10 %   sensor. true is returned if the switch / touch sensor is being pressed and false if it is 
    11 %   being released. The given port number specifies the connection port. The value port can be 
    12 %   addressed by the symbolic constants SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to 
     8%   |switch = GetSwitch(port)| returns the current switch value |switch| of the NXT switch / touch 
     9%   sensor. The measurement value |switch| represents the pressing mode of the switch / touch 
     10%   sensor. |true| is returned if the switch / touch sensor is being pressed and |false| if it is 
     11%   being released. The given |port| number specifies the connection port. The value |port| can be 
     12%   addressed by the symbolic constants |SENSOR_1|, |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to 
    1313%   the labeling on the NXT Brick. 
    1414% 
    15 %   For more complex settings the function NXT_GetInputValues can be used. 
     15%   For more complex settings the function |NXT_GetInputValues| can be used. 
    1616% 
    1717% Example 
    18 %   OpenSwitch(SENSOR_4); 
    19 %   switchState = GetSwitch(SENSOR_4); 
    20 %   CloseSensor(SENSOR_4); 
     18%+   OpenSwitch(SENSOR_4); 
     19%+   switchState = GetSwitch(SENSOR_4); 
     20%+   CloseSensor(SENSOR_4); 
    2121% 
    2222% See also: NXT_GetInputValues, OpenSwitch, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    2727%   Copyright: 2007-2008, RWTH Aachen University 
    2828% 
     29; 
    2930% 
    3031% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/GetUltrasonic.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   distance = GetUltrasonic(port) 
     5%   |distance = GetUltrasonic(port)| 
    66% 
    77% Description 
    8 %   distance = GetUltraSonic(port) returns the current measurement value distance of the NXT 
    9 %   ultrasonic sensor. distance represents the measured distance in cm. 
    10 %   The given port number specifies the connection port. The value port can be 
    11 %   addressed by the symbolic constants SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to 
     8%   |distance = GetUltraSonic(port)| returns the current measurement value |distance| of the NXT 
     9%   ultrasonic sensor. |distance| represents the measured distance in cm. 
     10%   The given |port| number specifies the connection port. The value |port| can be 
     11%   addressed by the symbolic constants |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to 
    1212%   the labeling on the NXT Brick. 
    1313% 
    14 %   For more complex settings the functions NXT_LSRead and NXT_LSWrite can be used. 
     14%   For more complex settings the functions |NXT_LSRead| and |NXT_LSWrite| can be used. 
    1515% 
    1616% Example 
    17 %   OpenUltrasonic(SENSOR_4); 
    18 %   distance = GetUltrasonic(SENSOR_4); 
    19 %   CloseSensor(SENSOR_4); 
     17%+   OpenUltrasonic(SENSOR_4); 
     18%+   distance = GetUltrasonic(SENSOR_4); 
     19%+   CloseSensor(SENSOR_4); 
    2020% 
    2121% See also: OpenUltrasonic, USMakeSnapshot, USGetSnapshotResults, CloseSensor, NXT_LSRead, NXT_LSWrite 
     
    2626%   Copyright: 2007-2008, RWTH Aachen University 
    2727% 
     28; 
    2829% 
    2930% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MAP_GetCommModule.m

    r201 r282  
    33 
    44% Syntax 
    5 %   map = MAP_GetCommModule() 
     5%   |map = MAP_GetCommModule()| 
    66% 
    77% Description 
    8 %   map = MAP_GetCommModule() returns the IO map of the communication module. The return 
    9 %   value map is a struct variable. It contains all communication module information.   
     8%   |map = MAP_GetCommModule()| returns the IO map of the communication module. The return 
     9%   value |map| is a struct variable. It contains all communication module information.   
    1010% 
    1111% Output: 
    12 %     map.PFunc              % ? 
    13 % 
    14 %     map.PFuncTwo           % ? 
    15 % 
    16 %     map.BTPort             % 1x4 cell array contains Bluetooth device information of each 
     12%     |map.PFunc|              % ? 
     13% 
     14%     |map.PFuncTwo|           % ? 
     15% 
     16%     |map.BTPort|             % 1x4 cell array contains Bluetooth device information of each 
    1717%                                NXT Bluetooth port (i = 0..3) 
    1818% 
    19 %     map.BTPort{i}.BtDeviceTableName            % name of the Bluetooth device 
    20 % 
    21 %     map.BTPort{i}.BtDeviceTableClassOfDevice   % class of the Bluetooth device 
    22 % 
    23 %     map.BTPort{i}.BtDeviceTableBdAddr          % MAC address of the Bluetooth device 
    24 % 
    25 %     map.BTPort{i}.BtDeviceTableDeviceStatus    % status of the Bluetooth device 
    26 % 
    27 %     map.BTPort{i}.BtConnectTableName           % name of the connected Bluetooth device 
    28 % 
    29 %     map.BTPort{i}.BtConnectTableClassOfDevice  % class of the connected Bluetooth device 
    30 % 
    31 %     map.BTPort{i}.BtConnectTablePinCode        % pin code of the connected Bluetooth device 
    32 % 
    33 %     map.BTPort{i}.BtConnetTableBdAddr          % MAC address of the connected Bluetooth device 
    34 % 
    35 %     map.BTPort{i}.BtConnectTableHandleNr       % handle nr of the connected Bluetooth device 
    36 % 
    37 %     map.BTPort{i}.BtConnectTableStreamStatus   % stream status of the connected Bluetooth device 
    38 % 
    39 %     map.BTPort{i}.BtConnectTableLinkQuality    % link quality of the connected Bluetooth device 
    40 % 
    41 %     map.BrickDataName               % name of the NXT brick 
    42 % 
    43 %     map.BrickDataBluecoreVersion    % Bluecore version number 
    44 % 
    45 %     map.BrickDataBdAddr             % MAC address of the NXT brick 
    46 % 
    47 %     map.BrickDataBtStateStatus      % Bluetooth state status 
    48 % 
    49 %     map.BrickDataBtHwStatus         % NXT hardware status 
    50 % 
    51 %     map.BrickDataTimeOutValue       % time out value 
    52 % 
    53 %     map.BtDeviceCnt                 % number of devices defined within the Bluetooth device table 
    54 % 
    55 %     map.BtDeviceNameCnt             % number of devices defined within the Bluetooth device table 
     19%     |map.BTPort{i}.BtDeviceTableName|            % name of the Bluetooth device 
     20% 
     21%     |map.BTPort{i}.BtDeviceTableClassOfDevice|   % class of the Bluetooth device 
     22% 
     23%     |map.BTPort{i}.BtDeviceTableBdAddr|          % MAC address of the Bluetooth device 
     24% 
     25%     |map.BTPort{i}.BtDeviceTableDeviceStatus|    % status of the Bluetooth device 
     26% 
     27%     |map.BTPort{i}.BtConnectTableName|           % name of the connected Bluetooth device 
     28% 
     29%     |map.BTPort{i}.BtConnectTableClassOfDevice|  % class of the connected Bluetooth device 
     30% 
     31%     |map.BTPort{i}.BtConnectTablePinCode|        % pin code of the connected Bluetooth device 
     32% 
     33%     |map.BTPort{i}.BtConnetTableBdAddr|          % MAC address of the connected Bluetooth device 
     34% 
     35%     |map.BTPort{i}.BtConnectTableHandleNr|       % handle nr of the connected Bluetooth device 
     36% 
     37%     |map.BTPort{i}.BtConnectTableStreamStatus|   % stream status of the connected Bluetooth device 
     38% 
     39%     |map.BTPort{i}.BtConnectTableLinkQuality|    % link quality of the connected Bluetooth device 
     40% 
     41%     |map.BrickDataName|               % name of the NXT brick 
     42% 
     43%     |map.BrickDataBluecoreVersion|    % Bluecore version number 
     44% 
     45%     |map.BrickDataBdAddr|             % MAC address of the NXT brick 
     46% 
     47%     |map.BrickDataBtStateStatus|      % Bluetooth state status 
     48% 
     49%     |map.BrickDataBtHwStatus|         % NXT hardware status 
     50% 
     51%     |map.BrickDataTimeOutValue|       % time out value 
     52% 
     53%     |map.BtDeviceCnt|                 % number of devices defined within the Bluetooth device table 
     54% 
     55%     |map.BtDeviceNameCnt|             % number of devices defined within the Bluetooth device table 
    5656%                                        (usually equal to BtDeviceCnt) 
    5757% 
    58 %     map.HsFlags                     % High Speed flags 
    59 % 
    60 %     map.HsSpeed                     % High Speed speed 
    61 % 
    62 %     map.HsState                     % High Speed state 
    63 % 
    64 %     map.HsSpeed                     % High Speed speed 
    65 % 
    66 %     map.UsbState                    % USB state 
     58%     |map.HsFlags|                     % High Speed flags 
     59% 
     60%     |map.HsSpeed|                     % High Speed speed 
     61% 
     62%     |map.HsState|                     % High Speed state 
     63% 
     64%     |map.HsSpeed|                     % High Speed speed 
     65% 
     66%     |map.UsbState|                    % USB state 
    6767% 
    6868% Examples 
    69 %   map = MAP_GetCommModule(); 
     69%+   map = MAP_GetCommModule(); 
    7070% 
    7171% See also: NXT_ReadIOMap 
     
    7676%   Copyright: 2007-2008, RWTH Aachen University 
    7777% 
     78; 
    7879% 
    7980% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MAP_GetInputModule.m

    r201 r282  
    33 
    44% Syntax 
    5 %   map = MAP_GetInputModule(port) 
     5%   |map = MAP_GetInputModule(port)| 
    66% 
    77% Description 
    8 %   map = MAP_GetInputModule(port) returns the IO map of the input module at the given sensor 
    9 %   port. The sensor port can be addressed by SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
    10 %   and 'all'. The return value map is a struct variable or cell array ('all' mode). 
     8%   |map = MAP_GetInputModule(port)| returns the IO map of the input module at the given sensor 
     9%   |port|. The sensor |port| can be addressed by |SENSOR_1|, |SENSOR_2|, |SENSOR_3|, |SENSOR_4| 
     10%   and |'all'|. The return value |map| is a struct variable or cell array (|'all'| mode). 
    1111%   It contains all input module information.   
    1212% 
    1313% Output: 
    14 %     map.CustomZeroOffset   % custom sensor zero offset value of a sensor. 
     14%     |map.CustomZeroOffset|   % custom sensor zero offset value of a sensor. 
    1515% 
    16 %     map.ADRaw              % raw 10-bit value last read from the ananlog to digital converter. Raw 
     16%     |map.ADRaw|              % raw 10-bit value last read from the ananlog to digital converter. Raw 
    1717%                                values produced by sensors typically cover some subset of the 
    1818%                                full 10-bit range.  
    1919% 
    20 %     map.SensorRaw          % raw sensor value 
     20%     |map.SensorRaw|          % raw sensor value 
    2121% 
    22 %     map.SensorValue        % tacho/angle limit, 0 means none set 
     22%     |map.SensorValue|        % tacho/angle limit, 0 means none set 
    2323% 
    24 %     map.SensorType         % sensor value 
     24%     |map.SensorType|         % sensor value 
    2525% 
    26 %     map.SensorMode         % sensor mode 
     26%     |map.SensorMode|         % sensor mode 
    2727% 
    28 %     map.SensorBoolean      % boolean sensor value 
     28%     |map.SensorBoolean|      % boolean sensor value 
    2929% 
    30 %     map.DigiPinsDir        % digital pins direction value of a sensor 
     30%     |map.DigiPinsDir|        % digital pins direction value of a sensor 
    3131% 
    32 %     map.DigiPinsIn         % digital pins status value of a sensor ? 
     32%     |map.DigiPinsIn|         % digital pins status value of a sensor ? 
    3333% 
    34 %     map.DigiPinsOut        % digital pins output level value of a sensor 
     34%     |map.DigiPinsOut|        % digital pins output level value of a sensor 
    3535% 
    36 %     map.CustomPctFullScale % custom sensor percent full scale value of the sensor. 
     36%     |map.CustomPctFullScale| % custom sensor percent full scale value of the sensor. 
    3737% 
    38 %     map.CustomActiveStatus % custom sensor active status value of the sensor 
     38%     |map.CustomActiveStatus| % custom sensor active status value of the sensor 
    3939% 
    40 %     map.InvalidData        % value of the InvalidData flag of the sensor 
     40%     |map.InvalidData|        % value of the InvalidData flag of the sensor 
    4141% 
    4242% 
    4343% Examples 
    44 %   map = MAP_GetInputModule(SENSOR_2); 
     44%+   map = MAP_GetInputModule(SENSOR_2); 
    4545% 
    46 %   map = MAP_GetInputModule('all'); 
     46%+   map = MAP_GetInputModule('all'); 
    4747% 
    4848% See also: NXT_ReadIOMap 
     
    5353%   Copyright: 2007-2008, RWTH Aachen University 
    5454% 
     55; 
    5556% 
    5657% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MAP_GetOutputModule.m

    r201 r282  
    33 
    44% Syntax 
    5 %   map = MAP_GetOutputModule(motor) 
     5%   |map = MAP_GetOutputModule(motor)| 
    66% 
    77% Description 
    8 %   map = MAP_GetOutputModule(motor) returns the IO map of the output module at the given 
    9 %   motor port. The motor port can be addressed by MOTOR_A, MOTOR_B, MOTOR_C and 'all'. 
    10 %   The return value map is a struct variable or cell array ('all' mode). It contains all 
     8%   |map = MAP_GetOutputModule(motor)| returns the IO map of the output module at the given 
     9%   |motor| port. The |motor| port can be addressed by |MOTOR_A|, |MOTOR_B|, |MOTOR_C| and |'all'|. 
     10%   The return value |map| is a struct variable or cell array (|'all'| mode). It contains all 
    1111%   output module information.   
    1212% 
    1313% Output: 
    14 %     map.TachoCount         % internal, non-resettable rotation-counter (in degrees) 
     14%     |map.TachoCount|         % internal, non-resettable rotation-counter (in degrees) 
    1515% 
    16 %     map.BlockTachoCount    % block tacho counter, current motor position, resettable using, 
     16%     |map.BlockTachoCount|    % block tacho counter, current motor position, resettable using, 
    1717%                              ResetMotorAngle (NXT-G counter since block start) 
    1818% 
    19 %     map.RotationCount      % rotation tacho counter, current motor position (NXT-G counter 
     19%     |map.RotationCount|      % rotation tacho counter, current motor position (NXT-G counter 
    2020%                              since program start) 
    2121% 
    22 %     map.TachoLimit         % tacho/angle limit, 0 means none set 
     22%     |map.TachoLimit|         % tacho/angle limit, 0 means none set 
    2323% 
    24 %     map.MotorRPM           % current pulse width modulation ? 
     24%     |map.MotorRPM|           % current pulse width modulation ? 
    2525% 
    26 %     map.Flags              % should be always ''. Flags are considered in MAP_SetOutputModule. 
     26%     |map.Flags|              % should be always ''. Flags are considered in MAP_SetOutputModule. 
    2727% 
    28 %     map.Mode               % output mode bitfield 1: MOTORON, 2: BRAKE, 4: REGULATED 
     28%     |map.Mode|               % output mode bitfield 1: MOTORON, 2: BRAKE, 4: REGULATED 
    2929% 
    30 %     map.ModeName           % output mode name interpreted by output mode bitfield 
     30%     |map.ModeName|           % output mode name interpreted by output mode bitfield 
    3131% 
    32 %     map.Speed              % motor power/speed 
     32%     |map.Speed|              % motor power/speed 
    3333% 
    34 %     map.ActualSpeed        % current actual percentage of full power (regulation mode) 
     34%     |map.ActualSpeed|        % current actual percentage of full power (regulation mode) 
    3535% 
    36 %     map.RegPParameter      % proportional term of the internal PID control algorithm 
     36%     |map.RegPParameter|      % proportional term of the internal PID control algorithm 
    3737% 
    38 %     map.RegIParameter      % integral term of the internal PID control algorithm 
     38%     |map.RegIParameter|      % integral term of the internal PID control algorithm 
    3939% 
    40 %     map.RegDParameter      % derivate term of the internal PID control algorithm 
     40%     |map.RegDParameter|      % derivate term of the internal PID control algorithm 
    4141% 
    42 %     map.RunStateByte       % run state byte 
     42%     |map.RunStateByte|       % run state byte 
    4343% 
    44 %     map.RunStateName       % run state name interpreted by run state byte 
     44%     |map.RunStateName|       % run state name interpreted by run state byte 
    4545%    
    46 %     map.RegModeByte        % regulation mode byte 
     46%     |map.RegModeByte|        % regulation mode byte 
    4747% 
    48 %     map.RegModeName        % regulation mode name interpreted by regulation mode byte 
     48%     |map.RegModeName|        % regulation mode name interpreted by regulation mode byte 
    4949% 
    50 %     map.Overloaded         % overloaded flag (true: speed regulation is unable to onvercome 
     50%     |map.Overloaded|         % overloaded flag (true: speed regulation is unable to onvercome 
    5151%                                physical load on the motor) 
    5252% 
    53 %     map.SyncTurnParam      % current turn ratio, 1: 25%, 2:50%, 3:75%, 4:100% of full volume 
     53%     |map.SyncTurnParam|      % current turn ratio, 1: 25%, 2:50%, 3:75%, 4:100% of full volume 
    5454% 
    5555% Examples 
    56 %   map = MAP_GetOutputModule(MOTOR_A); 
     56%+   map = MAP_GetOutputModule(MOTOR_A); 
    5757% 
    58 %   map = MAP_GetOutputModule('all'); 
     58%+   map = MAP_GetOutputModule('all'); 
    5959% 
    6060% See also: NXT_ReadIOMap 
     
    6565%   Copyright: 2007-2008, RWTH Aachen University 
    6666% 
     67; 
    6768% 
    6869% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MAP_GetSoundModule.m

    r201 r282  
    33 
    44% Syntax 
    5 %   map = MAP_GetSoundModule() 
     5%   |map = MAP_GetSoundModule()| 
    66% 
    77% Description 
    8 %   map = MAP_GetSoundModule() returns the IO map of the sound module. The return value map is 
     8%   |map = MAP_GetSoundModule()| returns the IO map of the sound module. The return value |map| is 
    99%   a struct variable. It contains all sound module information. 
    1010% 
    1111% Output: 
    12 %     map.Frequency          % frequency of the last played ton in Hz 
     12%     |map.Frequency|          % frequency of the last played ton in Hz 
    1313% 
    14 %     map.Duration           % duration of the last played ton in ms 
     14%     |map.Duration|           % duration of the last played ton in ms 
    1515% 
    16 %     map.SamplingRate       % current sound sample rate 
     16%     |map.SamplingRate|       % current sound sample rate 
    1717% 
    18 %     map.SoundFileName      % sound file name of the last played sound file 
     18%     |map.SoundFileName|      % sound file name of the last played sound file 
    1919% 
    20 %     map.Flags              % sound module flag, 'IDLE': sound module is idle, 'UPDATE': a 
     20%     |map.Flags|              % sound module flag, 'IDLE': sound module is idle, 'UPDATE': a 
    2121%                               request for plackback is pending, 'RUNNING': playback in 
    2222%                               progress. 
    2323% 
    24 %     map.State              % sound module state, 'IDLE'; sound module is idel, 
     24%     |map.State|              % sound module state, 'IDLE'; sound module is idel, 
    2525%                                'PLAYING_FILE': sound module is playing a .rso file, 
    2626%                                'PLAYING_TONE': a tone is playing, 'STOP': a request to stop 
    2727%                                playback is in progress.  
    2828% 
    29 %     map.Mode               % sound module mode, 'ONCE': only play file once , 'LOOP': play 
     29%     |map.Mode|               % sound module mode, 'ONCE': only play file once , 'LOOP': play 
    3030%                                file in a loop, 'TONE': play tone. 
    3131% 
    32 %     map.Volume             % volume: 0: diabled, 1: 25%, 2:50%, 3:75%, 4:100% of full volume 
     32%     |map.Volume|             % volume: 0: diabled, 1: 25%, 2:50%, 3:75%, 4:100% of full volume 
    3333% 
    3434% Examples 
    35 %   map = MAP_GetSoundModule(); 
     35%+   map = MAP_GetSoundModule(); 
    3636% 
    3737% See also: NXT_ReadIOMap 
     
    4242%   Copyright: 2007-2008, RWTH Aachen University 
    4343% 
     44; 
    4445% 
    4546% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MAP_GetUIModule.m

    r201 r282  
    33 
    44% Syntax 
    5 %   map = MAP_GetUIModule() 
     5%   |map = MAP_GetUIModule()| 
    66% 
    77% Description 
    8 %   map = MAP_GetUIModule() returns the IO map of the user interface module. The return 
    9 %   value map is a struct variable. It contains all user interface module information.   
     8%   |map = MAP_GetUIModule()| returns the IO map of the user interface module. The return 
     9%   value |map| is a struct variable. It contains all user interface module information.   
    1010% 
    1111% Output: 
    12 %     map.PMenu              % ? 
     12%     |map.PMenu|              % ? 
    1313% 
    14 %     map.BatteryVoltage     % battery voltage in mili volt.  
     14%     |map.BatteryVoltage|     % battery voltage in mili volt.  
    1515% 
    16 %     map.LMSfilename        % ? 
     16%     |map.LMSfilename|        % ? 
    1717% 
    18 %     map.Flags              % flag bitfield 
     18%     |map.Flags|              % flag bitfield 
    1919% 
    20 %     map.State              % state value 
     20%     |map.State|              % state value 
    2121% 
    22 %     map.Button             % button value 
     22%     |map.Button|             % button value 
    2323% 
    24 %     map.RunState           % VM run state 
     24%     |map.RunState|           % VM run state 
    2525% 
    26 %     map.BatteryState       % battery level (0..4) 
     26%     |map.BatteryState|       % battery level (0..4) 
    2727% 
    28 %     map.BluetoothState     % bluetooth state bitfield 
     28%     |map.BluetoothState|     % bluetooth state bitfield 
    2929% 
    30 %     map.UsbState           % USB state 
     30%     |map.UsbState|           % USB state 
    3131% 
    32 %     map.SleepTimout        % sleep timeout value in minutes 
     32%     |map.SleepTimout|        % sleep timeout value in minutes 
    3333% 
    34 %     map.SleepTimer         % current sleep timer in minutes 
     34%     |map.SleepTimer|         % current sleep timer in minutes 
    3535% 
    36 %     map.Rechargeable       % true if reachargeable battery is used 
     36%     |map.Rechargeable|       % true if reachargeable battery is used 
    3737% 
    38 %     map.Volume             % volume level (0..4) 
     38%     |map.Volume|             % volume level (0..4) 
    3939% 
    40 %     map.Error              % error value 
     40%     |map.Error|              % error value 
    4141% 
    42 %     map.OBPPointer         % on brick program pointer 
     42%     |map.OBPPointer|         % on brick program pointer 
    4343% 
    44 %     map.ForceOff           % turn off brick if value is true 
     44%     |map.ForceOff|           % turn off brick if value is true 
    4545% 
    4646% 
    4747% Examples 
    48 %   map = MAP_GetUIModule(); 
     48%+   map = MAP_GetUIModule(); 
    4949% 
    5050% See also: NXT_ReadIOMap 
     
    5555%   Copyright: 2007- 2008, RWTH Aachen University 
    5656% 
     57; 
    5758% 
    5859% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MAP_SetOutputModule.m

    r201 r282  
    33 
    44% Syntax 
    5 %   MAP_SetOutputModule(motor, map) 
    6 % 
    7 %   MAP_SetOutputModule(motor, map, varargin) 
     5%   |MAP_SetOutputModule(motor, map)| 
     6% 
     7%   |MAP_SetOutputModule(motor, map, varargin)| 
    88% 
    99% Description 
    10 %   map = MAP_SetOutputModule(motor, map) writes the IO map to the output module at the given motor 
    11 %   motor. The motor port can be addressed by MOTOR_A, MOTOR_B, MOTOR_C. The map structure has 
     10%   |map = MAP_SetOutputModule(motor, map)| writes the IO |map| to the output module at the given motor 
     11%   |motor|. The |motor| port can be addressed by |MOTOR_A|, |MOTOR_B|, |MOTOR_C|. The |map| structure has 
    1212%   to provide all output module information, listed below.  
    1313% 
    1414% Input: 
    15 %     map.TachoCount         % internal, non-resettable rotation-counter (in degrees) 
    16 % 
    17 %     map.BlockTachoCount    % block tacho counter, current motor position, resettable using, 
     15%     |map.TachoCount|         % internal, non-resettable rotation-counter (in degrees) 
     16% 
     17%     |map.BlockTachoCount|    % block tacho counter, current motor position, resettable using, 
    1818%                                ResetMotorAngle (NXT-G counter since block start) 
    1919% 
    20 %     map.RotationCount      % rotation tacho counter, current motor position (NXT-G counter 
     20%     |map.RotationCount|      % rotation tacho counter, current motor position (NXT-G counter 
    2121%                                since program start) 
    2222 
    23 %     map.TachoLimit         % current set tacho/angle limit, 0 means none set 
    24 % 
    25 %     map.MotorRPM           % current pulse width modulation ? 
    26 % 
    27 %     map.Flags              % update flag bitfield, commits any changing (see also varargin) 
    28 % 
    29 %     map.Mode               % output mode bitfield 1: MOTORON, 2: BRAKE, 4: REGULATED 
    30 % 
    31 %     map.Speed              % current motor power/speed 
    32 % 
    33 %     map.ActualSpeed        % current actual percentage of full power (regulation mode) 
    34 % 
    35 %     map.RegPParameter      % proportional term of the internal PID control algorithm 
    36 % 
    37 %     map.RegIParameter      % integral term of the internal PID control algorithm 
    38 % 
    39 %     map.RegDParameter      % derivate term of the internal PID control algorithm 
    40 % 
    41 %     map.RunStateByte       % run state byte 
    42 % 
    43 %     map.RegModeByte        % regulation mode byte 
    44 % 
    45 %     map.Overloaded         % overloaded flag (true: speed regulation is unable to onvercome 
     23%     |map.TachoLimit|         % current set tacho/angle limit, 0 means none set 
     24% 
     25%     |map.MotorRPM|           % current pulse width modulation ? 
     26% 
     27%     |map.Flags|              % update flag bitfield, commits any changing (see also varargin) 
     28% 
     29%     |map.Mode|               % output mode bitfield 1: MOTORON, 2: BRAKE, 4: REGULATED 
     30% 
     31%     |map.Speed|              % current motor power/speed 
     32% 
     33%     |map.ActualSpeed|        % current actual percentage of full power (regulation mode) 
     34% 
     35%     |map.RegPParameter|      % proportional term of the internal PID control algorithm 
     36% 
     37%     |map.RegIParameter|      % integral term of the internal PID control algorithm 
     38% 
     39%     |map.RegDParameter|      % derivate term of the internal PID control algorithm 
     40% 
     41%     |map.RunStateByte|       % run state byte 
     42% 
     43%     |map.RegModeByte|        % regulation mode byte 
     44% 
     45%     |map.Overloaded|         % overloaded flag (true: speed regulation is unable to onvercome 
    4646%                              physical load on the motor) 
    4747% 
    48 %     map.SyncTurnParam      % current turn ratio, 1: 25%, 2:50%, 3:75%, 4:100% of full volume 
     48%     |map.SyncTurnParam|      % current turn ratio, 1: 25%, 2:50%, 3:75%, 4:100% of full volume 
    4949% 
    5050%   map = MAP_SetOutputModule(motor, map, varargin) sets the update flags explicit by the given 
     
    6060% 
    6161% Examples 
    62 %  MAP_SetOutputModule(MOTOR_A, map); 
    63 % 
    64 %  map = MAP_GetOutputModule(MOTOR_A); 
    65 %  map.RegPParameter = 20; 
    66 %  MAP_SetOutputModule(MOTOR_A, map, 'UpdatePID'); 
     62%+  MAP_SetOutputModule(MOTOR_A, map); 
     63% 
     64%+  map = MAP_GetOutputModule(MOTOR_A); 
     65%+  map.RegPParameter = 20; 
     66%+  MAP_SetOutputModule(MOTOR_A, map, 'UpdatePID'); 
    6767% 
    6868% See also: MAP_GetOutputModule, NXT_WriteIOMap 
     
    7373%   Copyright: 2007-2008, RWTH Aachen University 
    7474% 
     75; 
    7576% 
    7677% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MOTOR_A.m

    r201 r282  
    33 
    44% Syntax 
    5 %   portA = MOTOR_A()  
     5%   |portA = MOTOR_A()|  
    66% 
    77% Description 
    8 % portA = MOTOR_A() returns 0 as the value portA. 
     8% |portA = MOTOR_A()| returns |0| as the value |portA|. 
    99% 
    1010% Example 
    11 % portA = MOTOR_A() 
    12 % %result: >> portA = 0 
     11%+ portA = MOTOR_A() 
     12%+ %result: >> portA = 0 
    1313% 
    1414% See also: MOTOR_B, MOTOR_C 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MOTOR_B.m

    r201 r282  
    33 
    44% Syntax 
    5 %   portB = MOTOR_B()  
     5%   |portB = MOTOR_B()|  
    66% 
    77% Description 
    8 % portB = MOTOR_B() returns 1 as the value portB. 
     8% |portB = MOTOR_B()| returns |1| as the value |portB|. 
    99% 
    1010% Example 
    11 % portB = MOTOR_B() 
    12 % %result: >> portB = 1 
     11%+ portB = MOTOR_B() 
     12%+ %result: >> portB = 1 
    1313% 
    1414% See also: MOTOR_A, MOTOR_C 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MOTOR_C.m

    r201 r282  
    33 
    44% Syntax 
    5 %   portC = MOTOR_C()  
     5%   |portC = MOTOR_C()|  
    66% 
    77% Description 
    8 % portC = MOTOR_C() returns 2 as the value portC. 
     8% |portC = MOTOR_C()| returns |2| as the value |portC|. 
    99% 
    1010% Example 
    11 % portC = MOTOR_C() 
    12 % %result: >> portC = 2 
     11%+ portC = MOTOR_C() 
     12%+ %result: >> portC = 2 
    1313% 
    1414% See also: MOTOR_A, MOTOR_B 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/MotorRotateAbs.m

    r201 r282  
    33 
    44% Syntax 
    5 %   MotorRotateAbs(port,abs_angle,power)  
     5%   |MotorRotateAbs(port,abs_angle,power)|  
    66% 
    77% Description 
    8 %   MotorRotateAbs(port,abs_angle,power) rotates the motor connected to the given 
    9 %   port. The value port can be addressed by the symbolic constants MOTOR_A, MOTOR_B and 
    10 %   MOTOR_C analog to the labeling on the NXT Brick. The angle determines the absolute angle to 
    11 %   rotate. power represents the motor power (1...100). 
     8%   |MotorRotateAbs(port,abs_angle,power)| rotates the motor connected to the given 
     9%   |port|. The value |port| can be addressed by the symbolic constants |MOTOR_A|, |MOTOR_B| and 
     10%   |MOTOR_C| analog to the labeling on the NXT Brick. The |angle| determines the absolute angle to 
     11%   rotate. |power| represents the motor power (|1...100|). 
    1212% 
    1313% Note: 
     
    1515% 
    1616% Example 
    17 %   MotorRotateAbs(MOTOR_B, 550, 30); 
     17%+   MotorRotateAbs(MOTOR_B, 550, 30); 
    1818%  
    1919% See also: SetMemoryCount, GetMemoryCount, NXT_SetOutputState, MOTOR_A, MOTOR_B, MOTOR_C 
     
    2424%   Copyright: 2007-2008, RWTH Aachen University 
    2525% 
     26; 
    2627% 
    2728% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_GetBatteryLevel.m

    r201 r282  
    33 
    44% Syntax 
    5 %   voltage = NXT_GetBatteryLevel()  
     5%   |voltage = NXT_GetBatteryLevel()|  
    66% 
    7 %   voltage = NXT_GetBatteryLevel(handle)  
     7%   |voltage = NXT_GetBatteryLevel(handle)|  
    88% 
    99% Description 
    10 %   voltage = NXT_GetBatteryLevel() returns the current battery level voltage of the NXT Brick in milli 
     10%   |voltage = NXT_GetBatteryLevel()| returns the current battery level |voltage| of the NXT Brick in milli 
    1111%   voltage. 
    1212% 
    13 %   voltage = NXT_GetBatteryLevel(handle) uses the given Bluetooth connection handle. This should be a 
     13%   |voltage = NXT_GetBatteryLevel(handle)| uses the given Bluetooth connection |handle|. This should be a 
    1414%   serial handle on a PC system and a file handle on a Linux system. 
    1515% 
    16 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     16%   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1717% 
    1818% Examples 
    19 %   voltage = NXT_GetBatteryLevel(); 
     19%+   voltage = NXT_GetBatteryLevel(); 
    2020% 
    21 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    22 %   voltage = NXT_GetBatteryLevel(handle); 
     21%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     22%+   voltage = NXT_GetBatteryLevel(handle); 
    2323% 
    2424% See also: COM_GetDefaultNXT, NXT_SendKeepAlive 
     
    2929%   Copyright: 2007-2008, RWTH Aachen University 
    3030% 
     31; 
    3132% 
    3233% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_GetFirmwareVersion.m

    r201 r282  
    33 
    44% Syntax 
    5 %   [protocol_version firmware_version] = NXT_GetFirmwareVersion() 
     5%   |[protocol_version firmware_version] = NXT_GetFirmwareVersion()| 
    66% 
    7 %   [protocol_version firmware_version] = NXT_GetFirmwareVersion(handle) 
     7%   |[protocol_version firmware_version] = NXT_GetFirmwareVersion(handle)| 
    88% 
    99% Description 
    10 %   [protocol_version firmware_version] = NXT_GetFirmwareVersion() returns the protocol and 
     10%   |[protocol_version firmware_version] = NXT_GetFirmwareVersion()| returns the protocol and 
    1111%   firmware version of the NXT as strings.  
    1212% 
    13 %   [protocol_version firmware_version] = NXT_GetFirmwareVersion(handle) uses the given 
    14 %   NXT connection handle. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system. 
     13%   |[protocol_version firmware_version] = NXT_GetFirmwareVersion(handle)| uses the given 
     14%   NXT connection |handle|. This should be a struct containing a serial handle on a PC system and a file handle on a Linux system. 
    1515% 
    16 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     16%   If no NXT |handle| is specified the default one (|COM_GetDefaultNXT|) is used. 
    1717% 
    1818% Examples 
    19 %   [protocol_version firmware_version] = NXT_GetFirmwareVersion(); 
     19%+   [protocol_version firmware_version] = NXT_GetFirmwareVersion(); 
    2020% 
    21 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    22 %   [protocol_version firmware_version] = NXT_GetFirmwareVersion(handle); 
     21%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     22%+   [protocol_version firmware_version] = NXT_GetFirmwareVersion(handle); 
    2323% 
    2424% See also: COM_GetDefaultNXT 
     
    2929%   Copyright: 2007-2008, RWTH Aachen University 
    3030% 
     31; 
    3132% 
    3233% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_GetInputValues.m

    r201 r282  
    33 
    44% Syntax 
    5 %   data = NXT_GetInputValues(port)  
    6 % 
    7 %   data = NXT_GetInputValues(port, handle)  
     5%   |data = NXT_GetInputValues(port)|  
     6% 
     7%   |data = NXT_GetInputValues(port, handle)|  
    88% 
    99% Description 
    10 %   data = NXT_GetInputValues(port) processes a complete sensor reading, i.e. requests input 
    11 %   values and collects the answer of the given sensor port. The value port can be addressed by 
    12 %   the symbolic constants SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling 
    13 %   on the NXT Brick. The return value data is a struct variable. It contains several sensor 
     10%   |data = NXT_GetInputValues(port)| processes a complete sensor reading, i.e. requests input 
     11%   values and collects the answer of the given sensor |port|. The value |port| can be addressed by 
     12%   the symbolic constants |SENSOR_1|, |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling 
     13%   on the NXT Brick. The return value |data| is a struct variable. It contains several sensor 
    1414%   settings and information.  
    1515% 
    16 %   data = NXT_GetInputValues(port, handle) uses the given Bluetooth connection handle. This should be a 
     16%   |data = NXT_GetInputValues(port, handle)| uses the given Bluetooth connection |handle|. This should be a 
    1717%   serial handle on a PC system and a file handle on a Linux system. 
    1818% 
    19 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     19%   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    2020% 
    2121% Output: 
    22 %     data.Port               % current port number (0..3) 
    23 % 
    24 %     data.Valid              % validation flag 
    25 % 
    26 %     data.Calibrated         % boolean, true if calibration file found and used 
    27 % 
    28 %     data.TypeByte           % sensor type 
    29 % 
    30 %     data.TypeName           % sensor mode 
    31 % 
    32 %     data.ModeByte           % mode 
    33 % 
    34 %     data.ModeName           % mode name 
    35 % 
    36 %     data.RawADVal           % raw A/D value 
    37 % 
    38 %     data.NormalizedADVal    % normalized A/D value 
    39 % 
    40 %     data.ScaledVal          % scaled value 
    41 % 
    42 %     data.CalibratedVal      % calibrated value 
     22%     |data.Port|               % current port number (|0..3|) 
     23% 
     24%     |data.Valid|              % validation flag 
     25% 
     26%     |data.Calibrated|         % boolean, |true| if calibration file found and used 
     27% 
     28%     |data.TypeByte|           % sensor type 
     29% 
     30%     |data.TypeName|           % sensor mode 
     31% 
     32%     |data.ModeByte|           % mode 
     33% 
     34%     |data.ModeName|           % mode name 
     35% 
     36%     |data.RawADVal|           % raw A/D value 
     37% 
     38%     |data.NormalizedADVal|    % normalized A/D value 
     39% 
     40%     |data.ScaledVal|          % scaled value 
     41% 
     42%     |data.CalibratedVal|      % calibrated value 
    4343% 
    4444% Note: 
    45 %   Data are only valid if .Valid is ~= 0. This should usually be the 
     45%   Data are only valid if |.Valid| is ~= 0. This should usually be the 
    4646%   case, but a short while after setting a new sensor mode using 
    47 %   NXT_SetInputMode, you have to carefully check .Valid on your own! 
    48 %   Experience shows that only .ScaledVal is influenced by this, apparently 
    49 %   .NormalizedADVal seems valid all the time, but closer examination is 
     47%   |NXT_SetInputMode|, you have to carefully check .Valid on your own! 
     48%   Experience shows that only |.ScaledVal| is influenced by this, apparently 
     49%   |.NormalizedADVal| seems valid all the time, but closer examination is 
    5050%   needed... 
    5151% 
     
    5353% 
    5454% Examples 
    55 %   data = NXT_GetInputValues(SENSOR_3); 
    56 % 
    57 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    58 %   data = NXT_GetInputValues(SENSOR_1, handle); 
     55%+   data = NXT_GetInputValues(SENSOR_3); 
     56% 
     57%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     58%+   data = NXT_GetInputValues(SENSOR_1, handle); 
    5959% 
    6060% See also: NXT_SetInputMode, GetLight, GetSwitch, GetSound, GetUltrasonic, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    6565%   Copyright: 2007-2008, RWTH Aachen University 
    6666% 
     67; 
    6768% 
    6869% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_GetOutputState.m

    r201 r282  
    33 
    44% Syntax 
    5 %   data = NXT_GetOutputState(port)  
    6 % 
    7 %   data = NXT_GetOutputState(port, handle)  
     5%   |data = NXT_GetOutputState(port)|  
     6% 
     7%   |data = NXT_GetOutputState(port, handle)|  
    88% 
    99% Description 
    10 %   data = NXT_GetOutputState(port) requests and retrieves an output motor state reading of the 
    11 %   given motor port. The value port can be addressed by the symbolic constants MOTOR_A, 
    12 %   MOTOR_B and MOTOR_C analog to the labeling on the NXT Brick.  The return value data is a 
     10%   |data = NXT_GetOutputState(port)| requests and retrieves an output motor state reading of the 
     11%   given motor |port|. The value |port| can be addressed by the symbolic constants |MOTOR_A|, 
     12%   |MOTOR_B| and |MOTOR_C| analog to the labeling on the NXT Brick.  The return value |data| is a 
    1313%   struct variable. It contains several motor settings and information.  
    1414% 
    15 %   data = NXT_GetOutputState(port, handle) uses the given Bluetooth connection handle. This should be a 
     15%   |data = NXT_GetOutputState(port, handle)| uses the given Bluetooth connection |handle|. This should be a 
    1616%   serial handle on a PC system and a file handle on a Linux system. 
    1717% 
    18 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     18%   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1919% 
    2020% Output: 
    21 %     data.Port               % current port number (0..3) 
    22 % 
    23 %     data.Power              % current motor power 
    24 % 
    25 %     data.Mode               % motor mode byte 
    26 % 
    27 %     data.ModeIsMOTORON      % flag: "motor is on" 
    28 % 
    29 %     data.ModeIsBRAKE        % flag: "motor uses the advanced brake mode (PVM)" 
    30 % 
    31 %     data.ModeIsREGULATED    % flag: "motor uses a regulation" 
    32 % 
    33 %     data.RegModeByte        % motor regulation byte 
    34 % 
    35 %     data.RegModeName        % name of regulation mode 
    36 % 
    37 %     data.TurnRatio          % turn ratio value 
    38 % 
    39 %     data.RunStateByte       % motor run state byte 
    40 % 
    41 %     data.RegStateName       % name of run state 
    42 % 
    43 %     data.TachoLimit         % tacho / angle limit 
    44 % 
    45 %     data.TachoCount         % current absolute tacho count 
    46 % 
    47 %     data.BlockTachoCount    % current relative tacho count 
    48 % 
    49 %     data.RotationCount      % current second relative tacho count 
     21%     |data.Port|               % current port number (|0..3|) 
     22% 
     23%     |data.Power|              % current motor power 
     24% 
     25%     |data.Mode|               % motor mode byte 
     26% 
     27%     |data.ModeIsMOTORON|      % flag: "motor is on" 
     28% 
     29%     |data.ModeIsBRAKE|        % flag: "motor uses the advanced brake mode (PVM)" 
     30% 
     31%     |data.ModeIsREGULATED|    % flag: "motor uses a regulation" 
     32% 
     33%     |data.RegModeByte|        % motor regulation byte 
     34% 
     35%     |data.RegModeName|        % name of regulation mode 
     36% 
     37%     |data.TurnRatio|          % turn ratio value 
     38% 
     39%     |data.RunStateByte|       % motor run state byte 
     40% 
     41%     |data.RegStateName|       % name of run state 
     42% 
     43%     |data.TachoLimit|         % tacho / angle limit 
     44% 
     45%     |data.TachoCount|         % current absolute tacho count 
     46% 
     47%     |data.BlockTachoCount|    % current relative tacho count 
     48% 
     49%     |data.RotationCount|      % current second relative tacho count 
    5050% 
    5151% For more details see the official LEGO Mindstorms communication protocol. 
    5252% 
    5353% Examples 
    54 %   data = NXT_GetOutputState(MOTOR_B); 
    55 % 
    56 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    57 %   data = NXT_GetOutputState(MOTOR_A, handle); 
     54%+   data = NXT_GetOutputState(MOTOR_B); 
     55% 
     56%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     57%+   data = NXT_GetOutputState(MOTOR_A, handle); 
    5858% 
    5959% See also: GetMotorSettings, SendMotorSettings, NXT_SetOutputState, MOTOR_A, MOTOR_B, MOTOR_C 
     
    6464%   Copyright: 2007-2008, RWTH Aachen University 
    6565% 
     66; 
    6667% 
    6768% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_LSGetStatus.m

    r201 r282  
    33 
    44% Syntax 
    5 %   [BytesReady status] = NXT_LSGetStatus(port)  
     5%   |[BytesReady status] = NXT_LSGetStatus(port)|  
    66% 
    7 %   [BytesReady status] = NXT_LSGetStatus(port, handle)  
     7%   |[BytesReady status] = NXT_LSGetStatus(port, handle)|  
    88% 
    99% Description 
    10 %   [BytesReady status] = NXT_LSGetStatus(port) gets the number of available bytes from the low speed (digital) 
    11 %   sensor reading of the given sensor port. The value port can be addressed by 
    12 %   the symbolic constants SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling 
    13 %   on the NXT Brick. The return value BytesReady contains the number of bytes available to read.  
    14 %   status indicates if an error occures by the packet transmission. Function checkStatusBytes 
     10%   |[BytesReady status] = NXT_LSGetStatus(port)| gets the number of available bytes from the low speed (digital) 
     11%   sensor reading of the given sensor |port|. The value |port| can be addressed by 
     12%   the symbolic constants |SENSOR_1|, |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling 
     13%   on the NXT Brick. The return value |BytesReady| contains the number of bytes available to read.  
     14%   |status| indicates if an error occures by the packet transmission. Function |checkStatusBytes| 
    1515%   is interpreting this information per default. 
    1616% 
    17 %   [BytesReady status] = NXT_LSGetStatus(port, handle) uses the given Bluetooth connection handle. This should be a 
     17%   |[BytesReady status] = NXT_LSGetStatus(port, handle)| uses the given Bluetooth connection |handle|. This should be a 
    1818%   serial handle on a PC system and a file handle on a Linux system. 
    1919% 
    20 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     20%   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    2121% 
    2222% For more details see the official LEGO Mindstorms communication protocol. 
     
    2828% 
    2929%   Before using LS commands, the sensor mode has to be set to 
    30 %   LOWSPEED_9V using the NXT_SetInputMode command. 
     30%   |LOWSPEED_9V| using the NXT_SetInputMode command. 
    3131% 
    3232% 
    3333% Examples 
    34 %   [BytesReady status] = NXT_LSGetStatus(SENSOR_3); 
     34%+   [BytesReady status] = NXT_LSGetStatus(SENSOR_3); 
    3535% 
    36 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    37 %   NXT_SetInputMode(SENSOR_1, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
    38 %   % note that status can contain errorsmessages, use checkStatusByte 
    39 %   [BytesReady status] = NXT_LSGetStatus(SENSOR_1, handle); 
     36%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     37%+   NXT_SetInputMode(SENSOR_1, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
     38%+   % note that status can contain errorsmessages, use checkStatusByte 
     39%+   [BytesReady status] = NXT_LSGetStatus(SENSOR_1, handle); 
    4040% 
    4141% See also: NXT_SetInputMode, checkStatusByte, NXT_LSWrite, NXT_LSRead 
     
    4747%   Copyright: 2007-2008, RWTH Aachen University 
    4848% 
     49; 
    4950% 
    5051% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_LSRead.m

    r201 r282  
    1 function [data BytesRead] = NXT_LSRead(port, varargin) 
     1function [data BytesRead optionalStatusByte] = NXT_LSRead(port, varargin) 
    22% Reads data from a low speed (digital) sensor 
    33 
    44% Syntax 
    5 %   [data BytesRead] = NXT_LSRead(port)  
     5%   |[data BytesRead] = NXT_LSRead(port)|  
    66% 
    7 %   [data BytesRead] = NXT_LSRead(port, handle)  
     7%   |[data BytesRead] = NXT_LSRead(port, handle)|  
     8% 
     9%   |[data BytesRead optionalStatusByte] = NXT_LSRead(port, [handle])|  
    810% 
    911% Description 
    10 %   [data BytesRead] = NXT_LSRead(port)) gets the data of the low speed (digital) sensor value 
    11 %   of the given sensor port. The value port can be addressed by the symbolic constants 
    12 %   SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. The 
    13 %   return value BytesRead contains the number of bytes available to read. 
     12%   |[data BytesRead] = NXT_LSRead(port))| gets the |data| of the low speed (digital) sensor value 
     13%   of the given sensor |port|. The value |port| can be addressed by the symbolic constants 
     14%   |SENSOR_1|, |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. The 
     15%   return value |BytesRead| contains the number of bytes available to read. 
    1416% 
    15 %   [data BytesRead] = NXT_LSRead(port, handle) uses the given Bluetooth connection handle. This should be a 
     17%   |[data BytesRead] = NXT_LSRead(port, handle)| uses the given Bluetooth connection |handle|. This should be a 
    1618%   serial handle on a PC system and a file handle on a Linux system. 
    1719% 
    18 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     20%   |[data BytesRead optionalStatusByte] = NXT_LSRead(port, [handle])| will 
     21%   ignore the automatic statusbyte check and instead return it as output 
     22%   argument. This causes the function to ignore erronous I2C calls or 
     23%   crashes if the sensor is not yet ready. You can effectively save a call 
     24%   to |NXT_LSGetStatus| with this, if you interpret the statusbytes 
     25%   correctly. This may vary, depending on your I2C sensor. The |handle| 
     26%   argument is still optional, like above. 
     27% 
     28%   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1929% 
    2030% 
     
    2737% 
    2838%   Before using LS commands, the sensor mode has to be set to 
    29 %   LOWSPEED_9V using the NXT_SetInputMode command. 
     39%   |LOWSPEED_9V| using the NXT_SetInputMode command. 
    3040% 
    3141% Examples 
    32 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    33 % 
    34 %   NXT_SetInputMode(SENSOR_1, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
    35 %   % usually we would use NXT_LSWrite before, to request some sort of reply 
    36 %   [data BytesRead] = NXT_LSRead(SENSOR_1, handle); 
     42%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     43%+ 
     44%+   NXT_SetInputMode(SENSOR_1, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
     45%+   % usually we would use NXT_LSWrite before, to request some sort of reply 
     46%+   [data BytesRead] = NXT_LSRead(SENSOR_1, handle); 
    3747% 
    3848% See also: NXT_SetInputMode, NXT_LSWrite, NXT_LSGetStatus 
     
    4454%   Copyright: 2007-2008, RWTH Aachen University 
    4555% 
     56; 
    4657% 
    4758% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_LSWrite.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_LSWrite(port, RXLength, data, ReplyMode)  
     5%   |NXT_LSWrite(port, RXLength, data, ReplyMode)|  
    66% 
    7 %   NXT_LSWrite(port, RXLength, data, ReplyMode, handle)  
     7%   |NXT_LSWrite(port, RXLength, data, ReplyMode, handle)|  
    88% 
    99% Description 
    10 %   NXT_LSWrite(port, RXLength, data, ReplyMode) writes the given data to a low speed (digital) 
    11 %   sensor of the given sensor port. The value port can be addressed by the symbolic constants 
    12 %   SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. The 
    13 %   value RXLength represents the data length of the expected receiving packet. By the ReplyMode 
    14 %   one can request an acknowledgement for the packet transmission. The two strings 'reply' and 
    15 %   'dontreply' are valid. 
     10%   |NXT_LSWrite(port, RXLength, data, ReplyMode)| writes the given |data| to a low speed (digital) 
     11%   sensor of the given sensor |port|. The value |port| can be addressed by the symbolic constants 
     12%   |SENSOR_1|, |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. The 
     13%   value |RXLength| represents the data length of the expected receiving packet. By the |ReplyMode| 
     14%   one can request an acknowledgement for the packet transmission. The two strings |'reply'| and 
     15%   |'dontreply'| are valid. 
    1616% 
    17 %   NXT_LSWrite(port, RXLength, data, ReplyMode, handle) uses the given Bluetooth connection 
    18 %   handle. This should be a serial handle on a PC system and a file handle on a Linux system. 
     17%   |NXT_LSWrite(port, RXLength, data, ReplyMode, handle)| uses the given Bluetooth connection 
     18%   |handle|. This should be a serial handle on a PC system and a file handle on a Linux system. 
    1919% 
    20 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     20%   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    2121% 
    2222% For more details see the official LEGO Mindstorms communication protocol. 
     
    2828% 
    2929%   Before using LS commands, the sensor mode has to be set to 
    30 %   LOWSPEED_9V using the NXT_SetInputMode command. 
     30%   |LOWSPEED_9V| using the NXT_SetInputMode command. 
    3131% 
    3232% Example 
    33 %   RequestLen = 1; 
    34 %   I2Cdata = hex2dec(['02'; '42']); % specific ultrasonic I²C command 
    35 % 
    36 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    37 %   NXT_SetInputMode(SENSOR_1, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
    38 % 
    39 %   NXT_LSWrite(SENSOR_1, RequestLen, I2Cdata, 'dontreply', handle); 
     33%+   RequestLen = 1; 
     34%+   I2Cdata = hex2dec(['02'; '42']); % specific ultrasonic I²C command 
     35%+    
     36%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     37%+   NXT_SetInputMode(SENSOR_1, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
     38%+ 
     39%+   NXT_LSWrite(SENSOR_1, RequestLen, I2Cdata, 'dontreply', handle); 
    4040% 
    4141% See also: NXT_SetInputMode, NXT_LSRead, NXT_LSGetStatus 
     
    4747%   Copyright: 2007-2008, RWTH Aachen University 
    4848% 
     49; 
    4950% 
    5051% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_PlaySoundFile.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_PlaySoundFile(filename, 'loop') 
     5%   |NXT_PlaySoundFile(filename, 'loop')| 
    66% 
    7 %   NXT_PlaySoundFile(filename, '', handle) 
     7%   |NXT_PlaySoundFile(filename, '', handle)| 
    88% 
    99% Description 
    10 %   NXT_PlaySoundFile(filename, loop) plays the soundfile stored on NXT Brick determined by 
    11 %   the string filename. The maximum length is limited to 15 characters. The file 
     10%   |NXT_PlaySoundFile(filename, loop)| plays the soundfile stored on NXT Brick determined by 
     11%   the string |filename|. The maximum length is limited to 15 characters. The file 
    1212%   extension '.rso' is added automatically if it was omitted. If the loop 
    13 %   parameter is equal to 'loop' the playback loop is activated. 
     13%   parameter is equal to |'loop'| the playback loop is activated. 
    1414% 
    15 %   NXT_PlaySoundFile(name, loop, handle) uses the given NXT connection handle. 
     15%   |NXT_PlaySoundFile(name, loop, handle)| uses the given NXT connection |handle|. 
    1616%   This should be a a struct containing a serial handle on a PC system and a file handle on a Linux system.  
    1717% 
    18 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     18%   If no Bluetooth |handle| is specified the default one (|COM_GetDefaultNXT|) is used. 
    1919% 
    2020% For more details see the official LEGO Mindstorms communication protocol. 
    2121% 
    2222% Examples 
    23 %   NXT_PlaySoundFile('Goodmorning', 0); 
     23%+   NXT_PlaySoundFile('Goodmorning', 0); 
    2424% 
    25 %   handle = NXT_OpenNXT('bluetooth.ini','check'); 
    26 %   NXT_StartProgram('Goodmorning.rso', 1, handle); 
     25%+   handle = NXT_OpenNXT('bluetooth.ini','check'); 
     26%+   NXT_StartProgram('Goodmorning.rso', 1, handle); 
    2727% 
    2828% See also: NXT_StopSoundPlayback 
     
    3333%   Copyright: 2007-2008, RWTH Aachen University 
    3434% 
     35; 
    3536% 
    3637% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_PlayTone.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_PlayTone(frequency, duration)  
     5%   |NXT_PlayTone(frequency, duration)|  
    66% 
    7 %   NXT_PlayTone(frequency, duration, handle) 
     7%   |NXT_PlayTone(frequency, duration, handle)| 
    88% 
    99% Description 
    10 %   NXT_PlayTone(frequency, duration) plays a tone of the frequency in Hz (200 - 14000Hz) and the 
    11 %   duration in milli seconds. 
     10%   |NXT_PlayTone(frequency, duration)| plays a tone of the |frequency| in Hz (200 - 14000Hz) and the 
     11%   |duration| in milli seconds. 
    1212% 
    13 %   NXT_PlayTone(frequency, duration, handle) sends the play tone command over the specific 
     13%   |NXT_PlayTone(frequency, duration, handle)| sends the play tone command over the specific 
    1414%   NXT handle (e.g. struct containing a serial handle (PC) / file handle (Linux)). 
    1515% 
    16 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     16%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1717% 
    1818% For more details see the official LEGO Mindstorms communication protocol. 
    1919% 
    2020% Examples 
    21 %   NXT_PlayTone(440, 100); 
     21%+   NXT_PlayTone(440, 100); 
    2222% 
    23 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    24 %   COM_SetDefaultNXT(handle); 
    25 %   NXT_PlayTone(1200, 120); 
     23%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     24%+   COM_SetDefaultNXT(handle); 
     25%+   NXT_PlayTone(1200, 120); 
    2626% 
    2727% See also: COM_GetDefaultNXT 
     
    3232%   Copyright: 2007-2008, RWTH Aachen University 
    3333% 
     34; 
    3435% 
    3536% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_ReadIOMap.m

    r201 r282  
    33 
    44% Syntax 
    5 %   bytes = NXT_ReadIOMap(mod_id, offset, n_bytes) 
     5%   |bytes = NXT_ReadIOMap(mod_id, offset, n_bytes)| 
    66% 
    7 %   bytes = NXT_ReadIOMap(mod_id, offset, n_bytes, handle) 
     7%   |bytes = NXT_ReadIOMap(mod_id, offset, n_bytes, handle)| 
    88% 
    99% Description 
    10 %   bytes = NXT_ReadIOMap(mod_id, offset, n_bytes) returns the data bytes of the module 
    11 %   identified by the given module ID mod_id. The total number of bytes is determined by n_bytes 
    12 %   and the position of the first byte index by the offset parameter. 
     10%   |bytes = NXT_ReadIOMap(mod_id, offset, n_bytes|) returns the data |bytes| of the module 
     11%   identified by the given module ID |mod_id|. The total number of bytes is determined by |n_bytes| 
     12%   and the position of the first byte index by the |offset| parameter. 
    1313% 
    14 %   bytes = NXT_ReadIOMap(mod_id, offset, n_bytes, handle) sends the IO map read command 
    15 %   over the specific NXT handle (e.g. serial handle (PC) / file handle (Linux)). 
     14%   |bytes = NXT_ReadIOMap(mod_id, offset, n_bytes, handle)| sends the IO map read command 
     15%   over the specific NXT |handle| (e.g. serial handle (PC) / file handle (Linux)). 
    1616% 
    17 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     17%   If no NXT |handle| is specified the default one (|COM_GetDefaultNXT|) is used. 
    1818% 
    1919% For more details see the official LEGO Mindstorms communication protocol. 
    2020% 
    2121% Examples 
    22 %   OutputModuleID = 131073 
    23 %   bytes = NXT_ReadIOMap(OutputModuleID, 0, 29); 
     22%+   OutputModuleID = 131073 
     23%+   bytes = NXT_ReadIOMap(OutputModuleID, 0, 29); 
    2424% 
    25 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    26 %   OutputModuleID = 131073 
    27 %   SoundModuleID = 524289, 0, 30, handle); 
     25%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     26%+   OutputModuleID = 131073 
     27%+   SoundModuleID = 524289, 0, 30, handle); 
    2828% 
    2929% See also: NXT_WriteIOMap, COM_GetDefaultNXT 
     
    3434%   Copyright: 2007-2008, RWTH Aachen University 
    3535% 
     36; 
    3637% 
    3738% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_ResetInputScaledValue.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_ResetInputScaledValue(port)  
     5%   |NXT_ResetInputScaledValue(port)|  
    66% 
    7 %   NXT_ResetInputScaledValue(port, handle) 
     7%   |NXT_ResetInputScaledValue(port, handle)| 
    88% 
    99% Description 
    10 %   NXT_ResetInputScaledValue(port) resets the sensors ScaledVal back to 0 of the given sensor 
    11 %   port. The value port can be addressed by the symbolic constants SENSOR_1, SENSOR_2, 
    12 %   SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. The ScaledVal is set by 
    13 %   function NXT_SetInputMode.  
     10%   |NXT_ResetInputScaledValue(port)| resets the sensors |ScaledVal| back to |0| of the given sensor 
     11%   |port|. The value |port| can be addressed by the symbolic constants |SENSOR_1|, |SENSOR_2|, 
     12%   |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. The |ScaledVal| is set by 
     13%   function |NXT_SetInputMode|.  
    1414% 
    15 %   NXT_ResetInputScaledValue(port, handle) uses the given NXT connection handle. This should be a 
     15%   |NXT_ResetInputScaledValue(port, handle)| uses the given NXT connection |handle|. This should be a 
    1616%   struct containing a serial handle on a PC system and a file handle on a Linux system. 
    1717% 
    18 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     18%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1919% 
    2020%   For more details see the official LEGO Mindstorms communication protocol. 
    2121% 
    2222% Note 
    23 %   This function should be called after using NXT_SetInputMode, before you want to actually use your new 
    24 %   special input value (to make sure counting starts at zero). See NXT_GetInputValues for more details 
     23%   This function should be called after using |NXT_SetInputMode|, before you want to actually use your new 
     24%   special input value (to make sure counting starts at zero). See |NXT_GetInputValues| for more details 
    2525%   about what kind of values are returned. 
    2626% 
    2727% Examples 
    28 %   NXT_ResetInputScaledValue(SENSOR_2); 
     28%+   NXT_ResetInputScaledValue(SENSOR_2); 
    2929% 
    30 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    31 %   NXT_ResetInputScaledValue(SENSOR_4, handle); 
     30%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     31%+   NXT_ResetInputScaledValue(SENSOR_4, handle); 
    3232% 
    3333% See also: NXT_SetInputMode, NXT_GetInputValues 
     
    3838%   Copyright: 2007-2008, RWTH Aachen University 
    3939% 
     40; 
    4041% 
    4142% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_ResetMotorPosition.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_ResetMotorPosition(port, isRelative)  
     5%   |NXT_ResetMotorPosition(port, isRelative)|  
    66% 
    7 %   NXT_ResetMotorPosition(port, isRelative, handle) 
     7%   |NXT_ResetMotorPosition(port, isRelative, handle)| 
    88% 
    99% Description 
    10 %   NXT_ResetMotorPosition(port, isRelative) resets the NXT internal counter of the given motor 
    11 %   port. The value port can be addressed by the symbolic constants MOTOR_A, MOTOR_B, 
    12 %   MOTOR_C analog to the labeling on the NXT Brick. The boolean flag isRelative determines the 
     10%   |NXT_ResetMotorPosition(port, isRelative)| resets the NXT internal counter of the given motor 
     11%   |port|. The value |port| can be addressed by the symbolic constants |MOTOR_A|, |MOTOR_B|, 
     12%   |MOTOR_C| analog to the labeling on the NXT Brick. The boolean flag |isRelative| determines the 
    1313%   relative (BlockTachoCount) or absolute counter (RotationCount).   
    1414% 
    15 %   NXT_ResetMotorPosition(port, handle) uses the given NXT connection handle. This should be a 
     15%   |NXT_ResetMotorPosition(port, handle)| uses the given NXT connection |handle|. This should be a 
    1616%   struct containing a serial handle on a PC system and a file handle on a Linux system. 
    1717% 
    18 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     18%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1919% 
    2020% For more details see the official LEGO Mindstorms communication protocol. 
    2121% 
    2222% Examples 
    23 %   NXT_ResetMotorPosition(MOTOR_B, true); 
     23%+   NXT_ResetMotorPosition(MOTOR_B, true); 
    2424% 
    25 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    26 %   NXT_ResetMotorPosition(MOTOR_A, false, handle); 
     25%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     26%+   NXT_ResetMotorPosition(MOTOR_A, false, handle); 
    2727% 
    2828% See also: COM_GetDefaultNXT 
     
    3333%   Copyright: 2007-2008, RWTH Aachen University 
    3434% 
     35; 
    3536% 
    3637% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_SendKeepAlive.m

    r201 r282  
    33 
    44% Syntax 
    5 %   [status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode)  
     5%   |[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode)|  
    66% 
    7 %   [status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode, handle) 
     7%   |[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode, handle)| 
    88% 
    99% Description 
    10 %   [status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode) sends a KeepAlive packet to the NXT 
    11 %   Brick to get the current sleep time limit of the Brick in milliseconds. By the ReplyMode 
    12 %   one can request an acknowledgement for the packet transmission. The two strings 'reply' and 
    13 %   'dontreply' are valid. status indicates if an error occures by the packet transmission. 
    14 %   Function checkStatusBytes is interpreting this information per default. The value 
    15 %   SleepTimeLimit contains the time in milliseconds after the NXT brick will turn off 
    16 %   automatically. The variable will only be set if ReplyMode is 'reply'. The sleep time limit 
     10%   |[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode)| sends a KeepAlive packet to the NXT 
     11%   Brick to get the current sleep time limit of the Brick in milliseconds. By the |ReplyMode| 
     12%   one can request an acknowledgement for the packet transmission. The two strings |'reply'| and 
     13%   |'dontreply'| are valid. |status| indicates if an error occures by the packet transmission. 
     14%   Function |checkStatusBytes| is interpreting this information per default. The value 
     15%   |SleepTimeLimit| contains the time in milliseconds after the NXT brick will turn off 
     16%   automatically. The variable will only be set if |ReplyMode| is |'reply'|. The sleep time limit 
    1717%   setting can only  be modified using the on-screen-menu on the brick itself. 
    1818% 
    19 %   Using 'dontreply' will just send a keep-alive packet. This means, the NXT internal counter when 
     19%   Using |'dontreply'| will just send a keep-alive packet. This means, the NXT internal counter when 
    2020%   to shut down automatically (this is a setting that can only be accessed directly on the NXT) 
    2121%   will be reset. This counter is not an inactivity counter: Bluetooth traffic will NOT stop the 
     
    2323%   Brick from turning off is to send a keep-alive packet within this time. 
    2424% 
    25 %   If you use replymode 'reply', SleepTimeLimit tells you the current setting on the brick, in 
     25%   If you use replymode |'reply'|, SleepTimeLimit tells you the current setting on the brick, in 
    2626%   milliseconds. 0 means sleep timer is disabled. -1 is an invalid answer: You obviously didn't use 
    27 %   'reply' and still tried to get an answer. 
     27%   |'reply'| and still tried to get an answer. 
    2828%  
    29 %   [status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode, handle) uses the given NXT 
    30 %   connection handle. This should be a struct containing a serial handle on a PC system and a file handle on a Linux 
     29%   |[status SleepTimeLimit] = NXT_SendKeepAlive(ReplyMode, handle)| uses the given NXT 
     30%   connection |handle|. This should be a struct containing a serial handle on a PC system and a file handle on a Linux 
    3131%   system.  
    3232% 
    33 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     33%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    3434% 
    3535%   For more details see the official LEGO Mindstorms communication protocol. 
    3636% 
    3737% Note: 
    38 %   This function is also used if you call COM_OpenNXT() with the optional 'check' parameter. Then 
     38%   This function is also used if you call |COM_OpenNXT()| with the optional |'check'| parameter. Then 
    3939%   a keep-alive packet is send and the answer will be received to check for a correctly working 
    4040%   bidirectional bluetooth connection. 
    4141% 
    4242% Examples 
    43 %   [status SleepTimeLimit] = NXT_SendKeepAlive('reply'); 
     43%+   [status SleepTimeLimit] = NXT_SendKeepAlive('reply'); 
    4444% 
    45 %   NXT_SendKeepAlive('dontreply'); 
     45%+   NXT_SendKeepAlive('dontreply'); 
    4646% 
    47 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    48 %   [status SleepTimeLimit] = NXT_SendKeepAlive('reply', handle); 
     47%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     48%+   [status SleepTimeLimit] = NXT_SendKeepAlive('reply', handle); 
    4949% 
    5050% See also: COM_OpenNXT, NXT_GetBatteryLevel 
     
    5555%   Copyright: 2007-2008, RWTH Aachen University 
    5656% 
     57; 
    5758% 
    5859% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_SetBrickName.m

    r201 r282  
    33 
    44% Syntax 
    5 %   [NXT_SetBrickName(name)  
     5%   |[NXT_SetBrickName(name)|  
    66% 
    7 %   NXT_SetBrickName(name, handle) 
     7%   |NXT_SetBrickName(name, handle)| 
    88% 
    99% Description 
    10 %   NXT_SetBrickName(name) sets a new name for the NXT Brick. The value name is a string value 
     10%   |NXT_SetBrickName(name)| sets a new |name| for the NXT Brick. The value |name| is a string value 
    1111%   and determines the new name of the Brick.  The maximum length is limited to 15 characters. 
    1212% 
    13 %   NXT_SetBrickName(name, handle) uses the given NXT connection handle. This should be 
     13%   |NXT_SetBrickName(name, handle)| uses the given NXT connection |handle|. This should be 
    1414%   a struct containing a serial handle on a PC system and a file handle on a Linux system.  
    1515% 
    16 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     16%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1717% 
    1818% For more details see the official LEGO Mindstorms communication protocol. 
    1919% 
    2020% Examples 
    21 %   NXT_SetBrickName('MyRobot'); 
     21%+   NXT_SetBrickName('MyRobot'); 
    2222% 
    23 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    24 %   NXT_SetBrickName('Mindy', handle); 
     23%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     24%+   NXT_SetBrickName('Mindy', handle); 
    2525% 
    2626% See also: COM_GetDefaultNXT, NXT_SendKeepAlive, NXT_GetBatteryLevel 
     
    3131%   Copyright: 2007-2008, RWTH Aachen University 
    3232% 
     33; 
    3334% 
    3435% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_SetInputMode.m

    r201 r282  
    33 
    44% Syntax 
    5 %   status = NXT_SetInputMode(port, SensorTypeDesc, SensorModeDesc, ReplyMode)  
     5%   |status = NXT_SetInputMode(port, SensorTypeDesc, SensorModeDesc, ReplyMode)|  
    66% 
    7 %   status = NXT_SetInputMode(port, SensorTypeDesc, SensorModeDesc, ReplyMode, handle) 
     7%   |status = NXT_SetInputMode(port, SensorTypeDesc, SensorModeDesc, ReplyMode, handle)| 
    88% 
    99% Description 
    10 %   status = NXT_SetInputMode(InputPort, SensorTypeDesc, SensorModeDesc, ReplyMode) sets mode, 
    11 %   configures and initializes the given sensor port to be ready to be read out. The value port 
    12 %   can be addressed by the symbolic constants SENSOR_1, SENSOR_2, SENSOR_3 and SENSOR_4 
    13 %   analog to the labeling on the NXT Brick. The value SensorTypeDesc determines the sensor type. 
    14 %   See all valid types below. SensorModeDesc represents the sensor mode. It specifies what mode 
    15 %   the .ScaledVal from NXT_GetInputValues should be. Valid parameters see below. By the 
    16 %   ReplyMode one can request an acknowledgement for the packet transmission. The two strings 
    17 %   'reply' and 'dontreply' are valid. The return value status indicates if an error occures 
     10%   |status = NXT_SetInputMode(InputPort, SensorTypeDesc, SensorModeDesc, ReplyMode)| sets mode, 
     11%   configures and initializes the given sensor |port| to be ready to be read out. The value |port| 
     12%   can be addressed by the symbolic constants |SENSOR_1|, |SENSOR_2|, |SENSOR_3| and |SENSOR_4| 
     13%   analog to the labeling on the NXT Brick. The value |SensorTypeDesc| determines the sensor type. 
     14%   See all valid types below. |SensorModeDesc| represents the sensor mode. It specifies what mode 
     15%   the |.ScaledVal| from |NXT_GetInputValues| should be. Valid parameters see below. By the 
     16%   |ReplyMode| one can request an acknowledgement for the packet transmission. The two strings 
     17%   |'reply'| and |'dontreply'| are valid. The return value |status| indicates if an error occures 
    1818%   by the packet transmission. 
    1919% 
    20 %   status = NXT_SetInputMode(InputPort, SensorTypeDesc, SensorModeDesc, ReplyMode, handle) 
    21 %   uses the given NXT connection handle. This should be a struct containing a serial handle on a PC system and 
     20%   |status = NXT_SetInputMode(InputPort, SensorTypeDesc, SensorModeDesc, ReplyMode, handle)| 
     21%   uses the given NXT connection |handle|. This should be a struct containing a serial handle on a PC system and 
    2222%   a file handle on a Linux system. 
    2323% 
    24 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     24%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    2525% 
    2626% Input: 
    27 %   *SensorTypeDesc:*  Valid types are (all strings): 
     27%   *|SensorTypeDesc|:*  Valid types are (all strings): 
    2828% 
    29 %                      NO_SENSOR       (nothing, use to close sensor port) 
     29%                      |NO_SENSOR|       (nothing, use to close sensor port) 
    3030% 
    31 %                      SWITCH          (NXT touch sensor, "binary") 
     31%                      |SWITCH|          (NXT touch sensor, "binary") 
    3232% 
    33 %                      LIGHT_ACTIVE    (NXT light sensor, red LED is on) 
     33%                      |LIGHT_ACTIVE|    (NXT light sensor, red LED is on) 
    3434% 
    35 %                      LIGHT_INACTIVE  (NXT light sensor, red LED is off) 
     35%                      |LIGHT_INACTIVE|  (NXT light sensor, red LED is off) 
    3636% 
    37 %                      SOUND_DB        (NXT sound sensor, unit dB) 
     37%                      |SOUND_DB|        (NXT sound sensor, unit dB) 
    3838% 
    39 %                      SOUND_DBA       (NXT sound sensor, unit dBA) 
     39%                      |SOUND_DBA|       (NXT sound sensor, unit dBA) 
    4040% 
    41 %                      LOWSPEED        (NXT, passive digital sensor) 
     41%                      |LOWSPEED|        (NXT, passive digital sensor) 
    4242% 
    43 %                      LOWSPEED_9V     (NXT, active digital sensor, e.g. UltraSonic) 
     43%                      |LOWSPEED_9V|     (NXT, active digital sensor, e.g. UltraSonic) 
    4444% 
    45 %                      TEMPERATURE     (old RCX sensor) 
     45%                      |TEMPERATURE|     (old RCX sensor) 
    4646% 
    47 %                      REFLECTION      (old RCX sensor) 
     47%                      |REFLECTION|      (old RCX sensor) 
    4848% 
    49 %                      ANGLE           (old RCX sensor) 
     49%                      |ANGLE|           (old RCX sensor) 
    5050% 
    51 %                      CUSTOM          (user defined) 
     51%                      |CUSTOM|          (user defined) 
    5252% 
    5353% 
    54 %   *SensorModeDesc:*  Valid modes are (all strings): 
     54%   *|SensorModeDesc|:*  Valid modes are (all strings): 
    5555% 
    56 %                      RAWMODE            (Fastest. RawADVal will be used) 
     56%                      |RAWMODE|            (Fastest. RawADVal will be used) 
    5757% 
    58 %                      BOOLEANMODE        (1 if above 45% threshold, else 0) 
     58%                      |BOOLEANMODE|        (1 if above 45% threshold, else 0) 
    5959% 
    60 %                      TRANSITIONCNTMODE  (count transitions of booleanmode) 
     60%                      |TRANSITIONCNTMODE|  (count transitions of booleanmode) 
    6161% 
    62 %                      PERIODCOUNTERMODE  (counr periods (up and down 
     62%                      |PERIODCOUNTERMODE|  (counr periods (up and down 
    6363%                                           transition) of boolean mode) 
    6464% 
    65 %                      PCTFULLSCALEMODE   (normalized percentage between 0 
     65%                      |PCTFULLSCALEMODE|   (normalized percentage between 0 
    6666%                                            and 100, use .NormalizedADVal 
    6767%                                            instead!) 
     
    6969% 
    7070%                      More exotic modes are: 
    71 %                      CELSIUSMODE        (RCX temperature only) 
     71%                      |CELSIUSMODE|        (RCX temperature only) 
    7272% 
    73 %                      FAHRENHEITMODE     (RCX temperature only) 
     73%                      |FAHRENHEITMODE|     (RCX temperature only) 
    7474% 
    75 %                      ANGLESTEPSMODE     (RCX rotation only) 
     75%                      |ANGLESTEPSMODE|     (RCX rotation only) 
    7676% 
    77 %                      SLOPEMASK          (what's this???) 
     77%                      |SLOPEMASK|          (what's this???) 
    7878% 
    79 %                      MODEMASK           (what's this???) 
     79%                      |MODEMASK|           (what's this???) 
    8080% 
    8181% 
     
    8383% 
    8484% Examples 
    85 %   status = NXT_SetInputMode(SENSOR_1, 'SOUND_DB', 'RAWMODE', 'dontreply'); 
     85%+   status = NXT_SetInputMode(SENSOR_1, 'SOUND_DB', 'RAWMODE', 'dontreply'); 
    8686% 
    87 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    88 %   status = NXT_SetInputMode(SENSOR_3, 'LIGHT_ACTIVE', 'RAWMODE', 'dontreply', handle); 
     87%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     88%+   status = NXT_SetInputMode(SENSOR_3, 'LIGHT_ACTIVE', 'RAWMODE', 'dontreply', handle); 
    8989% 
    9090% See also: NXT_GetInputValues, OpenLight, OpenSound, OpenSwitch, OpenUltrasonic, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    9595%   Copyright: 2007-2008, RWTH Aachen University 
    9696% 
     97; 
    9798% 
    9899% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_SetOutputState.m

    r252 r282  
    33 
    44% Syntax 
    5 %   status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)  
     5%   |status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)|  
    66% 
    7 %   status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, handle)  
     7%   |status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, handle)|  
    88% 
    99% Description 
    10 %   status = NXT_SetOutputState(OutputPorts, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, 
    11 %   RunStateName, TachoLimit, ReplyMode) sends the given settings like motor port (MOTOR_A, 
    12 %   MOTOR_B or MOTOR_C), the power (-100...100, the IsMotorOn boolean flag, the IsBrake 
    13 %   boolean flag, the regulation mode name RegModeName ('IDLE', 'SYNC', 'SPEED'), the 
    14 %   TurnRatio (-100...100), the RunStateName ('IDLE', 'RUNNING', 'RAMUP', 'RAMPDOWN'), 
    15 %   the TachoLimit (angle limit) in degrees, and the ReplyMode. By the ReplyMode one can request 
    16 %   an acknowledgement for the packet transmission. The two strings 'reply' and 'dontreply' are 
    17 %   valid. The return value status indicates if an error occures by the packet transmission. 
     10%   |status = NXT_SetOutputState(OutputPorts, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, 
     11%   RunStateName, TachoLimit, ReplyMode)| sends the given settings like motor |port| (|MOTOR_A|, 
     12%   |MOTOR_B| or |MOTOR_C|), the |power| (|-100...100|, the |IsMotorOn| boolean flag, the |IsBrake| 
     13%   boolean flag, the regulation mode name |RegModeName| (|'IDLE'|, |'SYNC'|, |'SPEED'|), the 
     14%   |TurnRatio| (|-100...100|), the |RunStateName| (|'IDLE'|, |'RUNNING'|, |'RAMUP'|, |'RAMPDOWN'|), 
     15%   the |TachoLimit| (angle limit) in degrees, and the |ReplyMode|. By the |ReplyMode| one can request 
     16%   an acknowledgement for the packet transmission. The two strings |'reply'| and |'dontreply'| are 
     17%   valid. The return value |status| indicates if an error occures by the packet transmission. 
    1818% 
    19 %   status = NXT_SetOutputState(OutputPorts, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, 
    20 %   RunStateName, TachoLimit, ReplyMode, handle) uses the given NXT connection handle. 
     19%   |status = NXT_SetOutputState(OutputPorts, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, 
     20%   RunStateName, TachoLimit, ReplyMode, handle)| uses the given NXT connection |handle|. 
    2121%   This should be a serial handle on a PC system and a file handle on a Linux system. 
    2222% 
    2323% Example 
    24 %   NXT_SetOutputState(MOTOR_A,80,1,1,'SPEED',0,'RUNNING',360,'dontreply'); 
     24%+   NXT_SetOutputState(MOTOR_A,80,1,1,'SPEED',0,'RUNNING',360,'dontreply'); 
    2525%  
    2626% See also: SendMotorSettings, NXT_GetOutputState, GetMotorSettings, MOTOR_A, MOTOR_B, MOTOR_C 
     
    3131%   Copyright: 2007-2008, RWTH Aachen University 
    3232% 
     33; 
    3334% 
    3435% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_StartProgram.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_StartProgram(filename)  
     5%   |NXT_StartProgram(filename)|  
    66% 
    7 %   NXT_StartProgram(filename, handle) 
     7%   |NXT_StartProgram(filename, handle)| 
    88% 
    99% Description 
    10 %   NXT_StartProgram(filename) starts the embedded NXT Brick program determined by the string 
    11 %   filename. The maximum length is limited to 15 characters. The file 
    12 %   extension '.rxe' is added automatically if it was omitted. 
     10%   |NXT_StartProgram(filename)| starts the embedded NXT Brick program determined by the string 
     11%   |filename|. The maximum length is limited to 15 characters. The file 
     12%   extension |'.rxe'| is added automatically if it was omitted. 
    1313% 
    14 %   NXT_SetBrickName(name, handle) uses the given NXT connection handle. This should be 
     14%   |NXT_SetBrickName(name, handle)| uses the given NXT connection |handle|. This should be 
    1515%   a struct containing a serial handle on a PC system and a file handle on a Linux system.  
    1616% 
    17 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     17%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1818% 
    1919% For more details see the official LEGO Mindstorms communication protocol. 
    2020% 
    2121% Examples 
    22 %   NXT_StartProgram('ResetCounter'); 
     22%+   NXT_StartProgram('ResetCounter'); 
    2323% 
    24 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    25 %   NXT_StartProgram('Demo.rxe', handle); 
     24%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     25%+   NXT_StartProgram('Demo.rxe', handle); 
    2626% 
    2727% See also: NXT_StopProgram 
     
    3232%   Copyright: 2007-2008, RWTH Aachen University 
    3333% 
     34; 
    3435% 
    3536% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_StopProgram.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_StopProgram()  
     5%   |NXT_StopProgram()|  
    66% 
    7 %   NXT_StopProgram(handle) 
     7%   |NXT_StopProgram(handle)| 
    88% 
    99% Description 
    10 %   NXT_StopProgram() stops the current running embedded NXT Brick program. 
     10%   |NXT_StopProgram()| stops the current running embedded NXT Brick program. 
    1111% 
    12 %   NXT_StopProgram(handle) uses the given NXT connection handle. This should be 
     12%   |NXT_StopProgram(handle)| uses the given NXT connection |handle|. This should be 
    1313%   a struct containing a serial handle on a PC system and a file handle on a Linux system.  
    1414% 
    15 %   If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used. 
     15%   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1616% 
    1717% For more details see the official LEGO Mindstorms communication protocol. 
    1818% 
    1919% Examples 
    20 %   NXT_StopProgram(); 
     20%+   NXT_StopProgram(); 
    2121% 
    22 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    23 %   NXT_StopProgram(handle); 
     22%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     23%+   NXT_StopProgram(handle); 
    2424% 
    2525% See also: NXT_StartProgram 
     
    3030%   Copyright: 2007-2008, RWTH Aachen University 
    3131% 
     32; 
    3233% 
    3334% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_StopSoundPlayback.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_StopSoundPlayback() 
     5%   |NXT_StopSoundPlayback()| 
    66% 
    7 %   NXT_StopSoundPlayback(handle) 
     7%   |NXT_StopSoundPlayback(handle)| 
    88% 
    99% Description 
    10 %   NXT_StopSoundPlayback() stops the current sound playback. 
     10%   |NXT_StopSoundPlayback()| stops the current sound playback. 
    1111% 
    12 %   NXT_StopSoundPlayback(handle) sends the stop sound playback command over the specific 
    13 %   Bluetooth handle (serial handle (PC) / file handle (Linux)). 
     12%   |NXT_StopSoundPlayback(handle)| sends the stop sound playback command over the specific 
     13%   Bluetooth |handle| (serial handle (PC) / file handle (Linux)). 
    1414% 
    15 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     15%   If no NXT |handle| is specified the default one (|COM_GetDefaultNXT|) is used. 
    1616% 
    1717% For more details see the official LEGO Mindstorms communication protocol. 
    1818% 
    1919% Examples 
    20 %   NXT_StopSoundPlayback(); 
     20%+   NXT_StopSoundPlayback(); 
    2121% 
    22 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    23 %   NXT_StopSoundPlayback(handle); 
     22%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     23%+   NXT_StopSoundPlayback(handle); 
    2424% 
    2525% See also: NXT_PlaySoundFile, NXT_PlayTone, COM_GetDefaultNXT 
     
    3030%   Copyright: 2007-2008, RWTH Aachen University 
    3131% 
     32; 
    3233% 
    3334% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/NXT_WriteIOMap.m

    r201 r282  
    33 
    44% Syntax 
    5 %   NXT_WriteIOMap(mod_id, offset, n_bytes, data) 
     5%   |NXT_WriteIOMap(mod_id, offset, n_bytes, data)| 
    66% 
    7 %   NXT_WriteIOMap(mod_id, offset, n_bytes, data, handle) 
     7%   |NXT_WriteIOMap(mod_id, offset, n_bytes, data, handle)| 
    88% 
    99% Description 
    10 %   NXT_WriteIOMap(mod_id, offset, n_bytes, data) write the data bytes to the given module ID (mod_id). 
    11 %   The total number of bytes is given by n_bytes. The offset parameter determines the index 
     10%   |NXT_WriteIOMap(mod_id, offset, n_bytes, data)| write the data |bytes| to the given module ID (|mod_id|). 
     11%   The total number of bytes is given by |n_bytes|. The |offset| parameter determines the index 
    1212%   position of the first byte. 
    1313% 
    14 %   NXT_WriteIOMap(mod_id, offset, n_bytes, data, handle) sends the IO map write command 
    15 %   over the specific NXT handle handle (e.g. serial handle (PC) / file handle (Linux)). 
     14%   |NXT_WriteIOMap(mod_id, offset, n_bytes, data, handle)| sends the IO map write command 
     15%   over the specific NXT handle |handle| (e.g. serial handle (PC) / file handle (Linux)). 
    1616% 
    17 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     17%   If no NXT |handle| is specified the default one (|COM_GetDefaultNXT)| is used. 
    1818% 
    1919% For more details see the official LEGO Mindstorms communication protocol. 
    2020% 
    2121% Examples 
    22 %   OutputModuleID = 131073 
    23 %   NXT_WriteIOMap(OutputModuleID, 0, 30, bytes; 
     22%+   OutputModuleID = 131073 
     23%+   NXT_WriteIOMap(OutputModuleID, 0, 30, bytes; 
    2424% 
    25 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    26 %   OutputModuleID = 131073 
    27 %   NXT_WriteIOMap(OutputModuleID, 0, 30, bytes, handle); 
     25%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     26%+   OutputModuleID = 131073 
     27%+   NXT_WriteIOMap(OutputModuleID, 0, 30, bytes, handle); 
    2828% 
    2929% See also: NXT_ReadIOMap, COM_GetDefaultNXT 
     
    3434%   Copyright: 2007-2008, RWTH Aachen University 
    3535% 
     36; 
    3637% 
    3738% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/OpenLight.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   OpenLight(port, mode) 
     5%   |OpenLight(port, mode)| 
    66% 
    77% Description 
    8 %   OpenLight(port, mode) initializes the input mode of NXT light sensor specified by the sensor 
    9 %   port and the light mode. The value port can be addressed by the symbolic constants 
    10 %   SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. The 
    11 %   mode represents one of two modes 'ACTIVE' (active illumination: red light on) and 'INACTIVE' 
     8%   |OpenLight(port, mode)| initializes the input mode of NXT light sensor specified by the sensor 
     9%   |port| and the light |mode|. The value |port| can be addressed by the symbolic constants 
     10%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. The 
     11%   |mode| represents one of two modes |'ACTIVE'| (active illumination: red light on) and |'INACTIVE'| 
    1212%   (passive illumination red light off). To deactive the active illumination the function 
    13 %   CloseSensor is used. 
     13%   |CloseSensor| is used. 
    1414% 
    15 %   For more complex settings the function NXT_SetInputMode can be used. 
     15%   For more complex settings the function |NXT_SetInputMode| can be used. 
    1616% 
    1717% Example 
    18 %   OpenLight(SENSOR_1, 'ACTIVE'); 
    19 %   light = GetLight(SENSOR_1); 
    20 %   CloseSensor(SENSOR_1); 
     18%+   OpenLight(SENSOR_1, 'ACTIVE'); 
     19%+   light = GetLight(SENSOR_1); 
     20%+   CloseSensor(SENSOR_1); 
    2121% 
    2222% See also: NXT_SetInputMode, CloseSensor, GetLight, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    2727%   Copyright: 2007-2008, RWTH Aachen University 
    2828% 
     29; 
    2930% 
    3031% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/OpenSound.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   OpenSound(port, mode) 
     5%   |OpenSound(port, mode)| 
    66% 
    77% Description 
    8 %   OpenSound(port, mode) initializes the input mode of NXT sound sensor specified by the sensor 
    9 %   port and the sound mode. The value port can be addressed by the symbolic constants 
    10 %   SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. The 
    11 %   mode represents one of two modes 'DB' (dB measurement) and 'DBA' (dBA measurement) 
     8%   |OpenSound(port, mode)| initializes the input mode of NXT sound sensor specified by the sensor 
     9%   |port| and the sound |mode|. The value |port| can be addressed by the symbolic constants 
     10%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. The 
     11%   |mode| represents one of two modes |'DB'| (dB measurement) and |'DBA'| (dBA measurement) 
    1212% 
    13 %   For more complex settings the function NXT_SetInputMode can be used. 
     13%   For more complex settings the function |NXT_SetInputMode| can be used. 
    1414% 
    1515% Examples 
    16 %   OpenSound(SENSOR_1, 'DB'); 
    17 %   sound = GetSound(SENSOR_1); 
    18 %   CloseSensor(SENSOR_1); 
     16%+   OpenSound(SENSOR_1, 'DB'); 
     17%+   sound = GetSound(SENSOR_1); 
     18%+   CloseSensor(SENSOR_1); 
    1919% 
    2020% See also: NXT_SetInputMode, GetSound, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    2525%   Copyright: 2007-2008, RWTH Aachen University 
    2626% 
     27; 
    2728% 
    2829% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/OpenSwitch.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   OpenSwitch(port) 
     5%   |OpenSwitch(port)| 
    66% 
    77% Description 
    8 %   OpenSound(port) initializes the input mode of NXT switch / touch sensor specified by the sensor 
    9 %   port. The value port can be addressed by the symbolic constants 
    10 %   SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. 
     8%   |OpenSound(port)| initializes the input mode of NXT switch / touch sensor specified by the sensor 
     9%   |port|. The value |port| can be addressed by the symbolic constants 
     10%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. 
    1111% 
    12 %   For more complex settings the function NXT_SetInputMode can be used. 
     12%   For more complex settings the function |NXT_SetInputMode| can be used. 
    1313% 
    1414% Example 
    15 %   OpenSwitch(SENSOR_4); 
    16 %   switchState = GetSwitch(SENSOR_4); 
    17 %   CloseSensor(SENSOR_4); 
     15%+   OpenSwitch(SENSOR_4); 
     16%+   switchState = GetSwitch(SENSOR_4); 
     17%+   CloseSensor(SENSOR_4); 
    1818% 
    1919% See also: NXT_SetInputMode, GetSwitch, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4 
     
    2424%   Copyright: 2007-2008, RWTH Aachen University 
    2525% 
     26; 
    2627% 
    2728% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/OpenUltrasonic.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   OpenUltrasonic(port) 
     5%   |OpenUltrasonic(port)| 
    66% 
    7 %   OpenUltrasonic(port, mode) 
     7%   |OpenUltrasonic(port, mode)| 
    88% 
    99% Description 
    10 %   OpenUltrasonic(port) initializes the input mode of NXT uktrasonic sensor specified by the sensor 
    11 %   port. The value port can be addressed by the symbolic constants 
    12 %   SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. 
     10%   |OpenUltrasonic(port)| initializes the input mode of NXT uktrasonic sensor specified by the sensor 
     11%   |port|. The value |port| can be addressed by the symbolic constants 
     12%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. 
    1313% 
    14 %   OpenUltrasonic(port, mode) can enable the snapshot mode if the value mode is equal to the string 
    15 %   'snapshot'. This mode provides the snap shot mode (or SINGLE_SHOT mode) of the NXT ultrasonic sensor, 
     14%   |OpenUltrasonic(port, mode)| can enable the snapshot mode if the value |mode| is equal to the string 
     15%   |'snapshot'|. This mode provides the snap shot mode (or SINGLE_SHOT mode) of the NXT ultrasonic sensor, 
    1616%   which provides several sensor readings in one step. See 
    17 %   USMakeSnapshot for more information. 
     17%   |USMakeSnapshot| for more information. 
    1818% 
    1919%   Since the NXT ultrasonic sensor is a digital sensor (that uses the I²C protocol), 
    20 %   the function NXT_SetInputMode cannot be used as for analog sensors. 
     20%   the function |NXT_SetInputMode| cannot be used as for analog sensors. 
    2121% 
    2222%   Note: When the US sensor is opened in snapshot mode, the function 
    23 %   GetUltrasonic does not work correctly! 
     23%   |GetUltrasonic| does not work correctly! 
    2424% 
    2525% 
    2626% Examples 
    27 %   OpenUltrasonic(SENSOR_4); 
    28 %   distance = GetUltrasonic(SENSOR_4); 
    29 %   CloseSensor(SENSOR_4); 
     27%+   OpenUltrasonic(SENSOR_4); 
     28%+   distance = GetUltrasonic(SENSOR_4); 
     29%+   CloseSensor(SENSOR_4); 
    3030% 
    31 %  port = SENSOR_4; 
    32 %  OpenUltrasonic(port, 'snapshot'); 
    33 %  % send out the ping 
    34 %  USMakeSnapshot(port); 
    35 %  % wait some time for the sound to travel 
    36 %  pause(0.1); % 100ms is probably too much, calculate using c_sound ;-) 
    37 %  % retrieve all the echos in 1 step 
    38 %  echos = USGetSnapshotResults(port); 
    39 %  CloseSensor(SENSOR_4); 
     31%+  port = SENSOR_4; 
     32%+  OpenUltrasonic(port, 'snapshot'); 
     33%+  % send out the ping 
     34%+  USMakeSnapshot(port); 
     35%+  % wait some time for the sound to travel 
     36%+  pause(0.1); % 100ms is probably too much, calculate using c_sound ;-) 
     37%+  % retrieve all the echos in 1 step 
     38%+  echos = USGetSnapshotResults(port); 
     39%+  CloseSensor(SENSOR_4); 
    4040% 
    4141% See also: GetUltrasonic, USMakeSnapshot, USGetSnapshotResults, CloseSensor 
     
    4646%   Copyright: 2007-2008, RWTH Aachen University 
    4747% 
     48; 
    4849% 
    4950% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/README

    r201 r282  
    6262The the command "bluetooth-applet --singleton" can be run from the console. After this, the script 
    6363"btconnect" should work. 
     64If you get the error message "Can't connect RFCOMM socket: Permission denied", try to remove the paired 
     65device inside the bluetooth-applet to force a new authorization 
    6466 
    6567 
  • branches/telle/RWTHMindstormsNXT-Lejos/README.txt

    r201 r282  
    6262The the command "bluetooth-applet --singleton" can be run from the console. After this, the script 
    6363"btconnect" should work. 
     64If you get the error message "Can't connect RFCOMM socket: Permission denied", try to remove the paired 
     65device inside the bluetooth-applet to force a new authorization. 
    6466 
    6567 
  • branches/telle/RWTHMindstormsNXT-Lejos/ResetMotorAngle.m

    r247 r282  
    33 
    44% Syntax 
    5 %   ResetMotorAngle(port)  
     5%   |ResetMotorAngle(port)|  
    66% 
    7 %   ResetMotorAngle(port, handle)  
     7%   |ResetMotorAngle(port, handle)|  
    88% 
    99% Description 
    10 %   ResetMotorAngle(port) resets the relative angle counter for the motor connected to the given 
    11 %   port. The value port can be addressed by the symbolic constants MOTOR_A, MOTOR_B and 
    12 %   MOTOR_C analog to the labeling on the NXT Brick. The relative counter can be read by the 
    13 %   function GetMotorSettings. 
     10%   |ResetMotorAngle(port)| resets the relative angle counter for the motor connected to the given 
     11%   |port|. The value |port| can be addressed by the symbolic constants |MOTOR_A|, |MOTOR_B| and 
     12%   |MOTOR_C| analog to the labeling on the NXT Brick. The relative counter can be read by the 
     13%   function |GetMotorSettings|. 
    1414%  
    15 %   ResetMotorAngle(port, handle) uses the given Bluetooth connection handle. This should be a 
     15%   |ResetMotorAngle(port, handle)| uses the given Bluetooth connection |handle|. This should be a 
    1616%   serial handle on a PC system and a file handle on a Linux system.  
    1717% 
    18 %   If no NXT handle is specified the default one (COM_GetDefaultNXT) is used. 
     18%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    1919% 
    2020% Examples 
    21 %   ResetMotorAngle(MOTOR_A); 
     21%+   ResetMotorAngle(MOTOR_A); 
    2222% 
    23 %   handle = COM_OpenNXT('bluetooth.ini','check'); 
    24 %   ResetMotorAngle(MOTOR_C, handle); 
     23%+   handle = COM_OpenNXT('bluetooth.ini','check'); 
     24%+   ResetMotorAngle(MOTOR_C, handle); 
    2525% 
    2626% See also: NXT_ResetMotorPosition, GetMotorSettings, MOTOR_A, MOTOR_B, MOTOR_C, COM_GetDefaultNXT 
     
    3131%   Copyright: 2007-2008, RWTH Aachen University 
    3232% 
     33; 
    3334% 
    3435% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SENSOR_1.m

    r201 r282  
    33 
    44% Syntax 
    5 %   port1 = SENSOR_1()  
     5%   |port1 = SENSOR_1()|  
    66% 
    77% Description 
    8 % port1 = SENSOR_1() returns 0 as the value port1. 
     8% |port1 = SENSOR_1()| returns |0| as the value |port1|. 
    99% 
    1010% Example 
    11 %  port1 = SENSOR_1() 
    12 %  %result: >> port1 = 0 
     11%+  port1 = SENSOR_1() 
     12%+  %result: >> port1 = 0 
    1313% 
    1414% See also: SENSOR_2, SENSOR_3, SENSOR_4 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SENSOR_2.m

    r201 r282  
    33 
    44% Syntax 
    5 %   port2 = SENSOR_2()  
     5%   |port2 = SENSOR_2()|  
    66% 
    77% Description 
    8 % port2 = SENSOR_2() returns 1 as the value port2. 
     8% |port2 = SENSOR_2()| returns |1| as the value |port2|. 
    99% 
    1010% Example 
    11 %  port2 = SENSOR_2() 
    12 %  %result: >> port2 = 1 
     11%+  port2 = SENSOR_2() 
     12%+  %result: >> port2 = 1 
    1313% 
    1414% See also: SENSOR_1, SENSOR_3, SENSOR_4 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SENSOR_3.m

    r201 r282  
    33 
    44% Syntax 
    5 %   port3 = SENSOR_3()  
     5%   |port3 = SENSOR_3()|  
    66% 
    77% Description 
    8 % port3 = SENSOR_3() returns 2 as the value port3. 
     8% |port3 = SENSOR_3()| returns |2| as the value |port3|. 
    99% 
    1010% Example 
    11 %  port3 = SENSOR_3() 
    12 %  %result: >> port3 = 2 
     11%+  port3 = SENSOR_3() 
     12%+  %result: >> port3 = 2 
    1313% 
    1414% See also: SENSOR_1, SENSOR_2, SENSOR_4 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SENSOR_4.m

    r201 r282  
    33 
    44% Syntax 
    5 %   port4 = SENSOR_4()  
     5%   |port4 = SENSOR_4()|  
    66% 
    77% Description 
    8 % port4 = SENSOR_4() returns 3 as the value port4. 
     8% |port4 = SENSOR_4()| returns |3| as the value |port4|. 
    99% 
    1010% Example 
    11 %  port4 = SENSOR_4() 
    12 %  %result: >> port4 = 3 
     11%+  port4 = SENSOR_4() 
     12%+  %result: >> port4 = 3 
    1313% 
    1414% See also: SENSOR_1, SENSOR_2, SENSOR_3 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SendMotorSettings.m

    r248 r282  
    33 
    44% Syntax 
    5 %   SendMotorSettings()  
    6 % 
    7 %   SendMotorSettings(port, power, angle, speedRegulation, syncedToMotor, turnRatio, rampMode)  
     5%   |SendMotorSettings()|  
     6% 
     7%   |SendMotorSettings(port, power, angle, speedRegulation, syncedToMotor, turnRatio, rampMode)|  
    88% 
    99% Description 
    10 %   SendMotorSettings() sends the previously specified settings of the current motor. The motor 
    11 %   settings are set by the functions SetMotor, SetPower, SetAngleLimit, SpeedRegulation, 
    12 %   SyncToMotor, SetTurnRatio and SetRampMode.  
    13 % 
    14 %   SendMotorSettings(port, power, angle, speedRegulation, syncedToMotor, turnRatio, rampMode) 
    15 %   sends the given settings like motor port (MOTOR_A, MOTOR_B or MOTOR_C), the power 
    16 %   (-100...100, the angle limit, speedRegulation ('on', 'off'), syncedToMotor 
    17 %   (MOTOR_A, MOTOR_B, MOTOR_C), turnRatio (-100...100) and rampMode ('off', 'up', 
    18 %   'down').  
     10%   |SendMotorSettings()| sends the previously specified settings of the current motor. The motor 
     11%   settings are set by the functions |SetMotor|, |SetPower|, |SetAngleLimit|, |SpeedRegulation|, 
     12%   |SyncToMotor|, |SetTurnRatio| and |SetRampMode|.  
     13% 
     14%   |SendMotorSettings(port, power, angle, speedRegulation, syncedToMotor, turnRatio, rampMode)| 
     15%   sends the given settings like motor |port| (|MOTOR_A|, |MOTOR_B| or |MOTOR_C|), the |power| 
     16%   (|-100...100|, the |angle| limit, |speedRegulation| (|'on'|, |'off'|), |syncedToMotor| 
     17%   (|MOTOR_A|, |MOTOR_B|, |MOTOR_C|), |turnRatio| (|-100...100|) and |rampMode| (|'off'|, |'up'|, 
     18%   |'down'|).  
    1919% 
    2020% Note: 
     
    2525% 
    2626% Example 
    27 %   SetMotor(MOTOR_B); 
    28 %       SyncToMotor(MOTOR_C); 
    29 %       SetPower(76); 
    30 %       SetAngleLimit(4*360); 
    31 %       SetTurnRatio(20); 
    32 %   SendMotorSettings(); 
     27%+   SetMotor(MOTOR_B); 
     28%+      SyncToMotor(MOTOR_C); 
     29%+      SetPower(76); 
     30%+      SetAngleLimit(4*360); 
     31%+      SetTurnRatio(20); 
     32%+   SendMotorSettings(); 
    3333% 
    3434% See also: GetMotorSettings, SetMotor, SetPower, SpeedRegulation, SyncToMotor, SetTurnRatio, SetRampMode, NXT_SetOutputState, MOTOR_A, MOTOR_B, MOTOR_C 
     
    3939%   Copyright: 2007-2008, RWTH Aachen University 
    4040% 
     41; 
    4142% 
    4243% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SetAngleLimit.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SetAngleLimit(limt)  
     5%   |SetAngleLimit(limt)|  
    66% 
    77% Description 
    8 %   SetAngleLimit(limt) sets the angle limit in degrees for the current motor, which is set by 
    9 %   function SetMotor. This setting takes only affect with the next SendMotorSettings command. 
     8%   |SetAngleLimit(limt)| sets the angle |limit| in degrees for the current motor, which is set by 
     9%   function |SetMotor|. This setting takes only affect with the next |SendMotorSettings| command. 
     10% 
     11%   Use |SetAngleLimit(0)| to deactivate this limit (hence the motor will run forever). 
    1012% 
    1113% Note: 
     
    1820% 
    1921% Example 
    20 %   SetMotor(MOTOR_B); 
    21 %       SetPower(76); 
    22 %       SetAngleLimit(720); 
    23 %   SendMotorSettings(); 
     22%+   SetMotor(MOTOR_B); 
     23%+      SetPower(76); 
     24%+      SetAngleLimit(720); 
     25%+   SendMotorSettings(); 
    2426% 
    2527% See also: SendMotorSettings, SetMotor, GetMotor 
     
    3032%   Copyright: 2007-2008, RWTH Aachen University 
    3133% 
     34; 
    3235% 
    3336% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SetMemoryCount.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SetMemoryCount(port, angle)  
     5%   |SetMemoryCount(port, angle)|  
    66% 
    77% Description 
    8 %   SetMemoryCount(port, angle)) sets the internal NXT memory counter (maual mapping replica) 
    9 %   of the given motor port. The value port can be addressed by the symbolic constants 
    10 %   MOTOR_A, MOTOR_B and MOTOR_C analog to the labeling on the NXT Brick. The value angle 
     8%   |SetMemoryCount(port, angle))| sets the internal NXT memory counter (maual mapping replica) 
     9%   of the given motor |port|. The value |port| can be addressed by the symbolic constants 
     10%   |MOTOR_A|, |MOTOR_B| and |MOTOR_C| analog to the labeling on the NXT Brick. The value |angle| 
    1111%   sets the value of the NXT memory counter (maunal mapping replica). 
    1212% 
     
    1515% 
    1616% Example 
    17 %   SetMemoryCount(MOTOR_B, 120); 
     17%+   SetMemoryCount(MOTOR_B, 120); 
    1818% 
    1919% See also: SetMemoryCounter, MOTOR_A, MOTOR_B, MOTOR_C 
     
    2424%   Copyright: 2007-2008, RWTH Aachen University 
    2525% 
     26; 
    2627% 
    2728% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SetMotor.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SetMotor(port)  
     5%   |SetMotor(port)|  
    66% 
    77% Description 
    8 %   SetMotor(port) sets the current motor on the given port as the current active motor which can be controlled 
    9 %   by SendMotorSettings. Changing motor settings take only an effect on the active motor. The 
    10 %   value port can be addressed by the symbolic constants MOTOR_A , MOTOR_B and MOTOR_C 
     8%   |SetMotor(port)| sets the current motor on the given |port| as the current active motor which can be controlled 
     9%   by |SendMotorSettings|. Changing motor settings take only an effect on the active motor. The 
     10%   value |port| can be addressed by the symbolic constants |MOTOR_A| , |MOTOR_B| and |MOTOR_C| 
    1111%   analog to the labeling on the NXT Brick. 
    1212% 
    13 %   The current motor setting can be returned by function GetMotor. 
     13%   The current motor setting can be returned by function |GetMotor|. 
    1414% 
    1515% Example 
    16 %   SetMotor(MOTOR_C); 
    17 %       SetPower(76); 
    18 %       SetAngleLimit(720); 
    19 %   SendMotorSettings(); 
     16%+   SetMotor(MOTOR_C); 
     17%+      SetPower(76); 
     18%+      SetAngleLimit(720); 
     19%+   SendMotorSettings(); 
    2020% 
    2121% See also: GetMotor, SendMotorSettings, MOTOR_A, MOTOR_B, MOTOR_C 
     
    2626%   Copyright: 2007-2008, RWTH Aachen University 
    2727% 
     28; 
    2829% 
    2930% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SetPower.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SetPower(power)  
     5%   |SetPower(power)|  
    66% 
    77% Description 
    8 %   SetPower(power) sets the power value of the current active motor which can be controlled 
    9 %   by SendMotorSettings. The value power has to be an Integer value within the interval 
    10 %   -100...100. It specifies the percentage of the maximal available power. Negative values 
     8%   |SetPower(power)| sets the |power| value of the current active motor which can be controlled 
     9%   by |SendMotorSettings|. The value |power| has to be an Integer value within the interval 
     10%   |-100...100|. It specifies the percentage of the maximal available power. Negative values 
    1111%   indicates a reverse rotation direction. The power setting takes only affect with the next 
    12 %   SendMotorSettings command.  
     12%   |SendMotorSettings| command.  
    1313% 
    1414% Example 
    15 %   SetMotor(MOTOR_B); 
    16 %       SetPower(-55); 
    17 %       SetAngleLimit(1200); 
    18 %   SendMotorSettings(); 
     15%+   SetMotor(MOTOR_B); 
     16%+      SetPower(-55); 
     17%+      SetAngleLimit(1200); 
     18%+   SendMotorSettings(); 
    1919% 
    2020% See also: SendMotorSettings, SetMotor 
     
    2525%   Copyright: 2007-2008, RWTH Aachen University 
    2626% 
     27; 
    2728% 
    2829% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SetRampMode.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SetRampMode(mode)  
     5%   |SetRampMode(mode)|  
    66% 
    77% Description 
    8 %   SetRampMode(mode) sets the ramp mode of the current active motor which can be controlled 
    9 %   by SendMotorSettings. The value mode can be either 'off', 'up' or 'down'. In the case 
    10 %   of 'off' no ramp up mode is used fo rthe current active motor. 'up' provides the motor to 
    11 %   accelerate from the current power speed to the next power speed set by SetPower during the 
    12 %   next rotation angle in degrees set by SetAngleLimit. 'down' provides a deceleration, respectively.   
    13 %   The mode setting takes only affect with the next SendMotorSettings command.  
     8%   |SetRampMode(mode)| sets the ramp |mode| of the current active motor which can be controlled 
     9%   by |SendMotorSettings|. The value |mode| can be either |'off'|, |'up'| or |'down'|. In the case 
     10%   of |'off'| no ramp up mode is used fo rthe current active motor. |'up'| provides the motor to 
     11%   accelerate from the current power speed to the next power speed set by |SetPower| during the 
     12%   next rotation angle in degrees set by |SetAngleLimit|. |'down'| provides a deceleration, respectively.   
     13%   The |mode| setting takes only affect with the next |SendMotorSettings| command.  
    1414% 
    1515% Examples 
    16 %   SetMotor(MOTOR_B); 
    17 %       SetPower(76); 
    18 %       SetAngleLimit(3600); 
    19 %       SetRampMode('up'); 
    20 %   SendMotorSettings(); 
     16%+   SetMotor(MOTOR_B); 
     17%+      SetPower(76); 
     18%+      SetAngleLimit(3600); 
     19%+      SetRampMode('up'); 
     20%+   SendMotorSettings(); 
    2121% 
    2222% See also: SendMotorSettings, SetPower, SetAngleLimit 
     
    2727%   Copyright: 2007-2008, RWTH Aachen University 
    2828% 
     29; 
    2930% 
    3031% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SetTurnRatio.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SetTurnRatio(ratio)  
     5%   |SetTurnRatio(ratio)|  
    66% 
    77% Description 
    8 %   SetTurnRatio(ratio) sets the turn ratio of the current active motor which can be controlled 
    9 %   by SendMotorSettings. The value ratio has to be wihtin the Integer interval -100...100. 
     8%   |SetTurnRatio(ratio)| sets the turn |ratio| of the current active motor which can be controlled 
     9%   by |SendMotorSettings|. The value |ratio| has to be wihtin the Integer interval |-100...100|. 
    1010%   The value specifies the ratio of power distribution between two motors (e.g. left and right 
    1111%   wheel of the robot). 
    12 %   The ratio setting takes only affect with the next SendMotorSettings command and if two 
    13 %   motors are synchronied with SyncToMotor.  
     12%   The |ratio| setting takes only affect with the next |SendMotorSettings| command and if two 
     13%   motors are synchronied with |SyncToMotor|.  
    1414% 
    1515%   According to the LEGO Mindstorms communication protocol documentation, a ratio of 0 means equal 
     
    2020% 
    2121% Note: 
    22 %   When using several motor commands with SyncToMotor statements, 
     22%   When using several motor commands with |SyncToMotor| statements, 
    2323%   unexpected behaviour can occur, due to the NXTs internal error correction counters. 
    24 %   Sometimes it can help to issue the commands NXT_ResetMotorPosition(port, true), 
    25 %   NXT_ResetMotorPosition(port, false) and StopMotor(port, 'off') for each of both  
     24%   Sometimes it can help to issue the commands |NXT_ResetMotorPosition(port, true)|, 
     25%   |NXT_ResetMotorPosition(port, false)| and |StopMotor(port, 'off')| for each of both  
    2626%   motors. Although this seems like a waste of packets, this can do the trick, especially 
    2727%   when working with certain turn ratios. 
    2828% 
    2929% Example 
    30 %   SetMotor(MOTOR_B); 
    31 %       SyncToMotor(MOTOR_A); 
    32 %       SetPower(76); 
    33 %       SetTurnRatio(50); 
    34 %   SendMotorSettings(); 
     30%+   SetMotor(MOTOR_B); 
     31%+      SyncToMotor(MOTOR_A); 
     32%+      SetPower(76); 
     33%+      SetTurnRatio(50); 
     34%+   SendMotorSettings(); 
    3535% 
    3636% See also: SendMotorSettings, SyncToMotor, SetMotor, SetPower 
     
    4141%   Copyright: 2007-2008, RWTH Aachen University 
    4242% 
     43; 
    4344% 
    4445% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SpeedRegulation.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SpeedRegulation(mode)  
     5%   |SpeedRegulation(mode)|  
    66% 
    77% Description 
    8 %   SpeedRegulation(mode) enables or disabled the speed regulation mode of the current active 
    9 %   motor which can be controlled by SendMotorSettings. The value mode can be equal to 'on' or 
    10 %   'off' which enables or disables the speed regulation. 
    11 %   The speed regulation setting takes only affect with the next SendMotorSettings command.  
     8%   |SpeedRegulation(mode)| enables or disabled the speed regulation mode of the current active 
     9%   motor which can be controlled by |SendMotorSettings|. The value |mode| can be equal to |'on'| or 
     10%   |'off'| which enables or disables the speed regulation. 
     11%   The speed regulation setting takes only affect with the next |SendMotorSettings| command.  
    1212% 
    1313%   The speed regulation provides the motor to rotate speed controlled. So rotations at low speeds 
     
    2020% 
    2121% Example 
    22 %   SetMotor(MOTOR_A); 
    23 %       SetPower(12); 
    24 %       SpeedRegulation('on'); 
    25 %   SendMotorSettings(); 
     22%+   SetMotor(MOTOR_A); 
     23%+      SetPower(12); 
     24%+      SpeedRegulation('on'); 
     25%+   SendMotorSettings(); 
    2626% 
    2727% See also: SendMotorSettings, SetMotor, SetPower 
     
    3232%   Copyright: 2007-2008, RWTH Aachen University 
    3333% 
     34; 
    3435% 
    3536% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/StopMotor.m

    r262 r282  
    33 
    44% Syntax 
    5 %   StopMotor(port, mode)  
     5%   |StopMotor(port, mode)|  
    66% 
    77% Description 
    8 %   StopMotor(ports, mode) stops the motor connected to the given ports. 
    9 %   The value port can be addressed by a string representing the label(s) 
     8%   |StopMotor(ports, mode)| stops the motor connected to the given |ports|.  
     9%   The value |port| can be addressed by a string representing the label(s) 
     10%   addressed by the symbolic constants |MOTOR_A|, |MOTOR_B|, |MOTOR_C| and |'all'| (all motor at at 
     11%   the same time) analog to the labeling on the NXT Brick. The argument |mode| can be equal to 
     12%   |'off'| which cuts off the electrical power to the specific motor, so called "COAST" mode. The 
     13 
    1014%   of the port on the brick ('A', 'B', 'C', or any combination) or the 
    1115%   indexes of the ports starting with 0, i.e., 0, 1, or 2 correspond to A, 
    1216%   B, and C respectively. The indexes may also be given as a string, e.g., 
    13 %   '1'. If all motors shall be stopped the string 'all' can be used for 
     17%   '1'. If all motors shall be stopped the string |'all'| can be used for 
    1418%   the first argument.   
    1519%    
     
    2327%  
    2428% Note: 
    25 %   The value port equal to 'all' can be used to stopp all motors at the 
    26 %   same time using only one single Bluetooth packet.  
     29%   The value |port| equal to |'all'| can be used to stopp all motors at the 
     30%   same time using only one single Bluetooth packet. After a |StopMotor|  
     31%   command the motor snychronization will be lost. 
    2732% 
    28 %   With mode equal to 'off', the motor will slowly stop spinning, but 
    29 %   using 'brake' applies real force to the motor to stand still at the 
    30 %   current position.  
     33%   With |mode| equal to |'off'|, the motor will slowly stop spinning, but  
     34%   using |'brake'| applies real force to the motor to stand still at the  
     35%   current position, just like a real brake.  
    3136%    
    32 %   When calling StopMotor(..., 'off'), internally the speed regulation  
    33 %   is turned off, while using 'brake' will enable speed regulation.  
     37%   When calling |StopMotor(..., 'off')|, internally the speed regulation 
     38%   is turned off, while using |'brake'| will enable speed regulation. 
    3439% 
    3540% Example 
    36 %   m = NXTmotor('A'); 
    37 %   m.Power = -55; 
    38 %   m.TachoLimit = 1200; 
     41%+   SetMotor(MOTOR_B); 
     42%+      SetPower(-55); 
     43%+      SetAngleLimit(1200); 
     44%+   SendMotorSettings(); 
     45%+ 
     46%+   WaitForMotor(MOTOR_A); 
     47%+ 
     48%+   StopMotor(MOTOR_B, 'brake'); 
     49%  
     50% Example (with use of NXTmotor object) 
     51%+   m = NXTmotor('A'); 
     52%+   m.Power = -55; 
     53%+   m.TachoLimit = 1200; 
     54%+ 
     55%+   m2 = NXTmotor('B'); 
     56%+   m2.Power = 60; 
     57%+ 
     58%+   send(m); 
     59%+   send(m2); 
     60%+ 
     61%+   wait(m); 
     62%+   
     63%+   StopMotor('all', 'brake'); 
    3964% 
    40 %   m2 = NXTmotor('B'); 
    41 %   m2.Power = 60; 
     65% See also: WaitForMotor, SendMotorSettings, MOTOR_A, MOTOR_B, MOTOR_C, NXTmotor, NXTmotor/stop 
    4266% 
    43 %   send(m); 
    44 %   send(m2); 
    45 % 
    46 %   wait(m); 
    47  
    48 %   StopMotor('all', 'brake'); 
    49 % 
    50 % See also: NXTmotor, NXTmotor/STOP 
    51 % 
    52  
    5367% Signature 
    5468%   Author: Aulis Telle, Linus Atorf, Alexander Behrens (see AUTHORS) 
     
    5670%   Copyright: 2007-2008, RWTH Aachen University 
    5771% 
     72; 
    5873% 
    5974% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SwitchLamp.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   SwitchLamp(port, mode) 
     5%   |SwitchLamp(port, mode)| 
    66% 
    77% Description 
    8 %   SwitchLamp(port, mode) turns the LEGO lamp on or off.  
    9 %   The given port number specifies the used motor port. The value port can be 
    10 %   addressed by the symbolic constants MOTOR_A , MOTOR_B and MOTOR_C analog to 
    11 %   the labeling on the NXT Brick. The value mode supports two modes 'on' and 'off' to turn 
     8%   |SwitchLamp(port, mode)| turns the LEGO lamp on or off.  
     9%   The given |port| number specifies the used motor port. The value |port| can be 
     10%   addressed by the symbolic constants |MOTOR_A| , |MOTOR_B| and |MOTOR_C| analog to 
     11%   the labeling on the NXT Brick. The value |mode| supports two modes |'on'| and |'off'| to turn 
    1212%   the lamp on and off. 
    1313% 
     
    1717%   full brightness (after a short while). 
    1818% 
    19 %   A StopMotor command with parameter 'off' will also turn off the lamp, but it is 
     19%   A |StopMotor| command with parameter |'off'| will also turn off the lamp, but it is 
    2020%   recommended to use this function when working with lamps for better readability. 
    2121% 
    2222% Examples 
    23 %   SwitchLamp(MOTOR_B, 'on'); 
     23%+   |SwitchLamp(MOTOR_B, 'on');| 
    2424% 
    25 %   SwitchLamp(MOTOR_A, 'off'); 
     25%+   |SwitchLamp(MOTOR_A, 'off');| 
    2626% 
    2727% See also: SetPower, SendMotorSettings, StopMotor, MOTOR_A, MOTOR_B, MOTOR_C 
     
    3232%   Copyright: 2007-2008, RWTH Aachen University 
    3333% 
     34; 
    3435% 
    3536% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/SyncToMotor.m

    r201 r282  
    33 
    44% Syntax 
    5 %   SyncToMotor(OtherMotor)  
     5%   |SyncToMotor(OtherMotor)|  
    66% 
    77% Description 
    8 %   SyncToMotor(OtherMotor) sets the synchronization mode to the curren active motor (set by 
    9 %   SetMotor) and the given motor port OtherMotor. The value OtherMotor can be addressed by 
    10 %   the symbolic constants MOTOR_A , MOTOR_B and MOTOR_C analog to the labeling on the NXT 
    11 %   Brick. The synchronization mode can be set off if the value OtherMotor is set equal to 
    12 %   'off'. The synchronization setting takes only affect with the next SendMotorSettings command.   
     8%   |SyncToMotor(OtherMotor)| sets the synchronization mode to the curren active motor (set by 
     9%   |SetMotor|) and the given motor port |OtherMotor|. The value |OtherMotor| can be addressed by 
     10%   the symbolic constants |MOTOR_A| , |MOTOR_B| and |MOTOR_C| analog to the labeling on the NXT 
     11%   Brick. The synchronization mode can be set off if the value |OtherMotor| is set equal to 
     12%   |'off'|. The synchronization setting takes only affect with the next |SendMotorSettings| command.   
    1313% 
    1414%   This means that both motors will act as if they were connected through an axle. Motors with more 
     
    2222%   settings set to it will be applied to both motors (until synchronisation is lost of course). 
    2323%   Once 2 motors are synced, you effectively control 2 motors with 1 set of commands. This means, 
    24 %   when calling SendMotorSettings, in fact 2 packets will be send to the 2 synced motors, hence 
     24%   when calling |SendMotorSettings|, in fact 2 packets will be send to the 2 synced motors, hence 
    2525%   you will experience about twice the lag than usual. Take this into consideration... 
    2626% 
    27 %   When using several motor commands with SyncToMotor statements, 
     27%   When using several motor commands with |SyncToMotor| statements, 
    2828%   unexpected behaviour can occur, due to the NXTs internal error correction counters. 
    29 %   Sometimes it can help to issue the commands NXT_ResetMotorPosition(port, true), 
    30 %   NXT_ResetMotorPosition(port, false) and StopMotor(port, 'off') for each of both  
     29%   Sometimes it can help to issue the commands |NXT_ResetMotorPosition(port, true)|, 
     30%   |NXT_ResetMotorPosition(port, false)| and |StopMotor(port, 'off')| for each of both  
    3131%   motors. Although this seems like a waste of packets, this can do the trick, especially 
    32 %   when working with certain turn ratios (see SetTurnRatio). 
     32%   when working with certain turn ratios (see |SetTurnRatio|). 
    3333% 
    3434% Example 
    35 %   SetMotor(MOTOR_B); 
    36 %       SyncToMotor(MOTOR_C); 
    37 %       SetPower(76); 
    38 %   SendMotorSettings(); 
     35%+   SetMotor(MOTOR_B); 
     36%+      SyncToMotor(MOTOR_C); 
     37%+      SetPower(76); 
     38%+   SendMotorSettings(); 
    3939% 
    4040% See also: SendMotorSettings, SetMotor, SetPower, SetTurnRatio 
     
    4545%   Copyright: 2007-2008, RWTH Aachen University 
    4646% 
     47; 
    4748% 
    4849% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/USGetSnapshotResults.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   echos = USGetSnapshotResults(port) 
     5%   |echos = USGetSnapshotResults(port)| 
    66% 
    77% Description 
    8 %   echos = USGetSnapshotResults(port) retrieves the echos originating 
    9 %   from the ping that was sent out with USMakeSnapshot(port) for the ultrasonic  
    10 %   sensor connected to port. In order for this to work, the sensor has 
    11 %   to have been opened in snapshot mode using OpenUltrasonic(port, 'snapshot'). 
     8%   |echos = USGetSnapshotResults(port)| retrieves the echos originating 
     9%   from the ping that was sent out with |USMakeSnapshot(port)| for the ultrasonic  
     10%   sensor connected to |port|. In order for this to work, the sensor has 
     11%   to have been opened in snapshot mode using |OpenUltrasonic(port, 'snapshot')|. 
    1212% 
    13 %   The vector echos always contains exactly 8 readings for up to  
     13%   The vector |echos| always contains exactly 8 readings for up to  
    1414%   8 echos that were recorded from one single signal. Depending on the  
    1515%   structure and reflections, this can only be one valid echo, or a lot of 
    1616%   interference. The values are distances, just as you'd expect from 
    17 %   GetUltrasonic. The values are sorted in order of appearance, so they 
     17%   |GetUltrasonic|. The values are sorted in order of appearance, so they 
    1818%   should also be sorted with increasing distances. 
    1919% 
    2020%   It is not known how exactly the measurements are to be interpreted! 
    2121% 
    22 %   Please make sure that after calling USGetSnapshotResults, there is a 
     22%   Please make sure that after calling |USGetSnapshotResults|, there is a 
    2323%   little time period for the sound waves to travel, to be reflected, and 
    2424%   be recorded by the sensor. You can estimate this using the speed of 
     
    2626% 
    2727%   Note: When the US sensor is opened in snapshot mode, the function 
    28 %   GetUltrasonic does not work correctly! 
     28%   |GetUltrasonic| does not work correctly! 
    2929% 
    3030% Example 
    31 %  port = SENSOR_4; 
    32 %  OpenUltrasonic(port, 'snapshot'); 
    33 %  % send out the ping 
    34 %  USMakeSnapshot(port); 
    35 %  % wait some time for the sound to travel 
    36 %  pause(0.1); % 100ms is probably too much, calculate using c_sound ;-) 
    37 %  % retrieve all the echos in 1 step 
    38 %  echos = USGetSnapshotResults(port); 
    39 %  CloseSensor(SENSOR_4); 
     31%+  port = SENSOR_4; 
     32%+  OpenUltrasonic(port, 'snapshot'); 
     33%+  % send out the ping 
     34%+  USMakeSnapshot(port); 
     35%+  % wait some time for the sound to travel 
     36%+  pause(0.1); % 100ms is probably too much, calculate using c_sound ;-) 
     37%+  % retrieve all the echos in 1 step 
     38%+  echos = USGetSnapshotResults(port); 
     39%+  CloseSensor(SENSOR_4); 
    4040% 
    4141% See also: OpenUltrasonic, GetUltrasonic, USMakeSnapshot, CloseSensor 
     
    4646%   Copyright: 2007-2008, RWTH Aachen University 
    4747% 
     48; 
    4849% 
    4950% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/USMakeSnapshot.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   USMakeSnapshot(port) 
     5%   |USMakeSnapshot(port)| 
    66% 
    77% Description 
    8 %   Call USMakeSnapshot(port) to make the specific ultrasonic sensor 
    9 %   connected to port send out one single signal (called "ping"). In 
     8%   Call |USMakeSnapshot(port)| to make the specific ultrasonic sensor 
     9%   connected to |port| send out one single signal (called "ping"). In 
    1010%   contrast to the US sensor's continous mode (that is invoked by a normal 
    11 %   OpenUltrasonic without the 'snapshot' parameter), the sensor will 
     11%   |OpenUltrasonic| without the |'snapshot'| parameter), the sensor will 
    1212%   only send out ultrasonic signals when this function is called. Up to 8 
    1313%   multiple echos will be recorded, and the according distances stored in 
    14 %   the sensor's internal memory. Use USGetSnapshotResults to retrieve 
     14%   the sensor's internal memory. Use |USGetSnapshotResults| to retrieve 
    1515%   those 8 readings in one step! 
    1616% 
    1717%   Note: When the US sensor is opened in snapshot mode, the function 
    18 %   GetUltrasonic does not work correctly! 
     18%   |GetUltrasonic| does not work correctly! 
    1919% 
    2020% Example 
    21 %  port = SENSOR_4; 
    22 %  OpenUltrasonic(port, 'snapshot'); 
    23 %  % send out the ping 
    24 %  USMakeSnapshot(port); 
    25 %  % wait some time for the sound to travel 
    26 %  pause(0.1); % 100ms is probably too much, calculate using c_sound ;-) 
    27 %  % retrieve all the echos in 1 step 
    28 %  echos = USGetSnapshotResults(port); 
    29 %  CloseSensor(SENSOR_4); 
     21%+  port = SENSOR_4; 
     22%+  OpenUltrasonic(port, 'snapshot'); 
     23%+  % send out the ping 
     24%+  USMakeSnapshot(port); 
     25%+  % wait some time for the sound to travel 
     26%+  pause(0.1); % 100ms is probably too much, calculate using c_sound ;-) 
     27%+  % retrieve all the echos in 1 step 
     28%+  echos = USGetSnapshotResults(port); 
     29%+  CloseSensor(SENSOR_4); 
    3030% 
    3131% See also: OpenUltrasonic, GetUltrasonic, USGetSnapshotResults, CloseSensor 
     
    3636%   Copyright: 2007-2008, RWTH Aachen University 
    3737% 
     38; 
    3839% 
    3940% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/WaitForMotor.m

    r201 r282  
    33 
    44% Syntax 
    5 %   WaitForMotor(port)  
     5%   |WaitForMotor(port)|  
    66% 
    7 %   WaitForMotor(port, time)  
     7%   |WaitForMotor(port, time)|  
    88% 
    99% Description 
    10 %   WaitForMotor(port) pauses other MALTAB executions until the motor connected to the given 
    11 %   port is not running anymore. The value port can be addressed by the symbolic constants 
    12 %   MOTOR_A, MOTOR_B and MOTOR_C analog to the labeling on the NXT Brick.  
     10%   |WaitForMotor(port)| pauses other MALTAB executions until the motor connected to the given 
     11%   |port| is not running anymore. The value |port| can be addressed by the symbolic constants 
     12%   |MOTOR_A|, |MOTOR_B| and |MOTOR_C| analog to the labeling on the NXT Brick.  
    1313%  
    14 %   WaitForMotor(port, time) specifies a maximum timeout (waiting time in seconds) until 
     14%   |WaitForMotor(port, time)| specifies a maximum timeout (waiting time in seconds) until 
    1515%   execution will be continued anyway 
    1616% 
     
    2424%   slightly later than expected (depending on Bluetooth connection 
    2525%   quality). Be aware of this (for example by setting an angle limit using 
    26 %   SetAngleLimit) to take precautions. 
     26%   |SetAngleLimit|) to take precautions. 
    2727% 
    2828% Example 
    29 %   SetMotor(MOTOR_B); 
    30 %       SetPower(-55); 
    31 %       SetAngleLimit(1200); 
    32 %   SendMotorSettings(); 
    33 % 
    34 %   WaitForMotor(MOTOR_A); 
    35 % 
    36 %   StopMotor(MOTOR_B, 'brake'); 
     29%+   SetMotor(MOTOR_B);  
     30%+      SetPower(-55); 
     31%+      SetAngleLimit(1200); 
     32%+   SendMotorSettings(); 
     33%+ 
     34%+   WaitForMotor(MOTOR_A); 
     35%+ 
     36%+   StopMotor(MOTOR_B, 'brake'); 
    3737% 
    3838% See also: SendMotorSettings, StopMotor, MOTOR_A, MOTOR_B, MOTOR_C 
     
    4343%   Copyright: 2007-2008, RWTH Aachen University 
    4444% 
     45; 
    4546% 
    4647% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/checkStatusByte.m

    r201 r282  
    33 
    44% Syntax 
    5 %   [flag err_message] = checkStatusByte(response)  
     5%   |[flag err_message] = checkStatusByte(response)|  
    66% 
    77% Description 
    8 %   [flag err_message] = checkStatusByte(response) interpretes the response byte (not 
    9 %   hexadecimal). The return value flag indicates wether an error has occured  
    10 %   (true = error, false = success). The string value err_message contains 
     8%   |[flag err_message] = checkStatusByte(response)| interpretes the |response| byte (not 
     9%   hexadecimal). The return value |flag| indicates wether an error has occured  
     10%   (|true| = error, |false| = success). The string value |err_message| contains 
    1111%   the error message (or '' in case of success). 
    1212% 
    1313% Example 
    14 %   [status SleepTimeLimit] = NXT_SendKeepAlive('reply'); 
    15 %   [err errmsg] = checkStatusByte(status); 
     14%+   [status SleepTimeLimit] = NXT_SendKeepAlive('reply'); 
     15%+   [err errmsg] = checkStatusByte(status); 
    1616% 
    1717% See also: COM_CollectPacket, NXT_LSGetStatus 
     
    2222%   Copyright: 2007-2008, RWTH Aachen University 
    2323% 
     24; 
    2425% 
    2526% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/byte2outputmode.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   [isMOTORON isBRAKE isREGULATED] = byte2outputmode(byte) 
     5%   |[isMOTORON isBRAKE isREGULATED] = byte2outputmode(byte)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/byte2regmode.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   name = byte2regmode(byte) 
     5%   |name = byte2regmode(byte)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/byte2runstate.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   name = byte2runstate(byte) 
     5%   |name = byte2runstate(byte)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/byte2sensormode.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   name = byte2sensormode(byte) 
     5%   |name = byte2sensormode(byte)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/byte2sensortype.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   name = byte2sensortype(byte) 
     5%   |name = byte2sensortype(byte)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/checkHandleStruct.m

    r247 r282  
    1818%   Date: 2008/07/01 
    1919%   Copyright: 2007-2008, RWTH Aachen University 
     20; 
    2021% 
    2122% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/commandbyte2name.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   name = commandbyte2name(byte) 
     5%   |name = commandbyte2name(byte)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/createHandleStruct.m

    r247 r282  
    3434%   Date: 2008/07/01 
    3535%   Copyright: 2007-2008, RWTH Aachen University 
     36; 
    3637% 
    3738% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/dec2wordbytes.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   bytes = dec2wordbytes(val, n, varargin) 
     5%   |bytes = dec2wordbytes(val, n, varargin)| 
    66% 
    77% Description 
     
    2222%   Copyright: 2007-2008, RWTH Aachen University 
    2323% 
     24; 
    2425% 
    2526% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/fantom_proto.m

    r201 r282  
    1616%   Date: 2008/03/29 
    1717%   Copyright: 2007-2008, RWTH Aachen University 
     18; 
    1819% 
    1920% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/getReplyLengthFromCmdByte.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   len = getReplyLengthFromCmdByte(byte) 
     5%   |len = getReplyLengthFromCmdByte(byte)| 
    66% 
    77% Description 
     
    1919%   Copyright: 2007-2008, RWTH Aachen University 
    2020% 
     21; 
    2122% 
    2223% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/getVISAErrorString.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   errorstring=getVISAErrorString(commandstatus) 
     5%   |errorstring=getVISAErrorString(commandstatus)| 
    66% 
    77% Description 
     
    2020%   Copyright: 2007-2008, RWTH Aachen University 
    2121% 
     22; 
    2223% 
    2324% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/initializeGlobalMotorStateVar.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   NXTMOTOR_State = initializeGlobalMotorStateVar 
     5%   |NXTMOTOR_State = initializeGlobalMotorStateVar| 
    66% 
    77% Description 
     
    1616%   Copyright: 2007-2008, RWTH Aachen University 
    1717% 
     18; 
    1819% 
    1920% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/isdebug.m

    r201 r282  
    33 
    44% Syntax 
    5 %   ret = isdebug;  
     5%   |ret = isdebug;|  
    66% 
    77% Description 
    8 %   Used as a fast alternative to strcmpi(DebugMode(), 'on'), this function 
    9 %   returns true if the current debug state for textOut() is 'on', and false 
    10 %   if it is 'off'. 
     8%   Used as a fast alternative to |strcmpi(DebugMode(), 'on')|, this function 
     9%   returns |true| if the current debug state for |textOut()| is |'on'|, and |false| 
     10%   if it is |'off'|. 
    1111% 
    1212%   Since string handling takes CPU time, sometimes you might want to omit 
    1313%   generating large or complex debug messages that would be discarded anyway. You 
    14 %   can check this by putting an if isdebug before the actual textOut 
     14%   can check this by putting an |if isdebug| before the actual |textOut| 
    1515%   statement. 
    1616%  
    17 %   Note: isdebug can return [] if textOut() has never been called before. 
    18 %   This is not a problem, since if isdebug still works like expected. Be 
     17%   Note: isdebug can return |[]| if |textOut()| has never been called before. 
     18%   This is not a problem, since |if isdebug| still works like expected. Be 
    1919%   careful though! 
    2020% 
    2121% Example 
    22 %   if isdebug 
    23 %      % only generate this debug message if it will be displayed 
    24 %      textOut(sprintf('Current packet: %s \n', ... 
    25 %              horzcat(dec2hex(Packet, 2),  blanks(length(Packet))')')); 
    26 %   end%if 
     22%+   if isdebug 
     23%+      % only generate this debug message if it will be displayed 
     24%+      textOut(sprintf('Current packet: %s \n', ... 
     25%+              horzcat(dec2hex(Packet, 2),  blanks(length(Packet))')')); 
     26%+   end%if 
    2727% 
    2828% See also: textOut, DebugMode 
     
    3333%   Copyright: 2007-2008, RWTH Aachen University 
    3434% 
     35; 
    3536% 
    3637% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/libusb_proto.m

    r201 r282  
    1616%   Date: 2008/04/29 
    1717%   Copyright: 2007-2008, RWTH Aachen University 
     18; 
    1819% 
    1920% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/name2commandbytes.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   [type cmd bytes] = name2commandbytes(name) 
     5%   |[type cmd bytes] = name2commandbytes(name)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/outputmode2byte.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   byte = outputmode2byte(varargin) 
     5%   |byte = outputmode2byte(varargin)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/regmode2byte.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   byte = regmode2byte(name) 
     5%   |byte = regmode2byte(name)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/runstate2byte.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   byte = runstate2byte(name) 
     5%   |byte = runstate2byte(name)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/sensormode2byte.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   byte = sensormode2byte(name) 
     5%   |byte = sensormode2byte(name)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/sensortype2byte.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   byte = sensortype2byte(name) 
     5%   |byte = sensortype2byte(name)| 
    66% 
    77% Description 
     
    1414%   Copyright: 2007-2008, RWTH Aachen University 
    1515% 
     16; 
    1617% 
    1718% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/private/wordbytes2dec.m

    r201 r282  
    33% 
    44% Syntax 
    5 %   res = wordbytes2dec(bytes, n, varargin) 
     5%   |res = wordbytes2dec(bytes, n, varargin)| 
    66% 
    77% Description 
     
    2121%   Copyright: 2007-2008, RWTH Aachen University 
    2222% 
     23; 
    2324% 
    2425% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/readFromIniFile.m

    r201 r282  
    33 
    44% Syntax 
    5 %   ret = readFromIniFile(AppName, KeyName, filename)  
     5%   |ret = readFromIniFile(AppName, KeyName, filename)|  
    66% 
    77% Description 
     
    2727% 
    2828% Examples: 
    29 %    %a sample ini file (sample.ini) may have entries: 
    30 %    % 
    31 %    %   [XYZ] 
    32 %    %   abc=123 
    33 %    %   def=7 
    34 %    %   ; lines starting with a ; are comments 
    35 %    %   [ZZZ] 
    36 %    %   abc=890 
     29%+    %a sample ini file (sample.ini) may have entries: 
     30%+    % 
     31%+    %   [XYZ] 
     32%+    %   abc=123 
     33%+    %   def=7 
     34%+    %   ; lines starting with a ; are comments 
     35%+    %   [ZZZ] 
     36%+    %   abc=890 
    3737% 
    38 % readFromIniFile('XYZ','abc', 'sample.ini') % will return '123' 
     38%+ readFromIniFile('XYZ','abc', 'sample.ini') % will return '123'  
    3939% 
    40 % readFromIniFile('ZZZ','abc', 'sample.ini') % will return '890' 
     40%+ readFromIniFile('ZZZ','abc', 'sample.ini') % will return '890'  
    4141% 
    42 % readFromIniFile('XYZ','def', 'sample.ini') % will return '7' 
     42%+ readFromIniFile('XYZ','def', 'sample.ini') % will return '7'  
    4343% 
    4444% Signature 
     
    4747%   Copyright: 2007-2008, RWTH Aachen University 
    4848% 
     49; 
    4950% 
    5051% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/textOut.m

    r201 r282  
    33 
    44% Syntax 
    5 %   textOut(strMsg)  
     5%   |textOut(strMsg)|  
    66%    
    7 %   textOut(strMsg, 'screenonly') 
     7%   |textOut(strMsg, 'screenonly')| 
    88% 
    9 %   textOut(strMsg, 'logonly') 
     9%   |textOut(strMsg, 'logonly')| 
    1010% 
    1111% Description 
    12 %   textOut(strMsg) will write to screen (command window) AND logfile, if global logging is 
     12%   |textOut(strMsg)| will write to screen (command window) AND logfile, if global logging is 
    1313%   enabled.  
    1414% 
    15 %   textOut(strMsg, 'screenonly') writes to screen (command window) only. 
     15%   |textOut(strMsg, 'screenonly')| writes to screen (command window) only. 
    1616% 
    17 %   textOut(strMsg, 'logonly') writes to logfile only (global logging must be enabled). If logging 
     17%   |textOut(strMsg, 'logonly')| writes to logfile only (global logging must be enabled). If logging 
    1818%   is disabled or somehow failes, the message will not be logged or displayed at all... 
    1919% 
    2020% Note: 
    21 %   To enable logging (to file), set the global var EnableLogging to true and 
    22 %   set Logfilename to a valid filename. This function distinguishes between 
     21%   To enable logging (to file), set the global var |EnableLogging| to |true| and 
     22%   set |Logfilename| to a valid filename. This function distinguishes between 
    2323%   Windows and Linux systems to use proper linebreaks. 
    24 %   The global variable DisableScreenOut is an on/off switch for the 
     24%   The global variable |DisableScreenOut| is an on/off switch for the 
    2525%   complete textOut()-messages that would appear on the command window. 
    26 %   Default setting is false, i.e. there will be no output. 
     26%   Default setting is |false|, i.e. there will be no output. 
    2727%  
    2828%   Recommended usage is together with sprintf(), in order to add 
     
    3030% 
    3131% Examples 
    32 %  textOut('This is a message\n'); 
     32%+  textOut('This is a message\n'); 
    3333% 
    34 %  x = 'world'; 
    35 %  y = 2007; 
    36 %  textOut(sprintf('Hello %s, it is the year %d!\n', x, y)); 
    37 %  %Results in:  >> Hello world, it is the year 2007! 
     34%+  x = 'world'; 
     35%+  y = 2007; 
     36%+  textOut(sprintf('Hello %s, it is the year %d!\n', x, y)); 
     37%+  %Results in:  >> Hello world, it is the year 2007! 
    3838% 
    39 %  global EnableLogging 
    40 %  global Logfilename 
    41 %  EnableLogging = true; 
    42 %  Logfilename = 'logfile.txt'; 
    43 %  textOut(sprintf('Whatever I say here will be logged to the file as well.\n')); 
     39%+  global EnableLogging 
     40%+  global Logfilename 
     41%+  EnableLogging = true; 
     42%+  Logfilename = 'logfile.txt'; 
     43%+  textOut(sprintf('Whatever I say here will be logged to the file as well.\n')); 
    4444%  
    45 %  textOut(sprintf('Only appears in the command window\n'), 'screenonly'); 
     45%+  textOut(sprintf('Only appears in the command window\n'), 'screenonly'); 
    4646% 
    47 %  textOut(sprintf('Only appears in the logfile, if logging enabled\n'), 'logonly'); 
     47%+  textOut(sprintf('Only appears in the logfile, if logging enabled\n'), 'logonly'); 
    4848% 
    49 %  global DisableScreenOut 
    50 %  DisableScreenOut = true; 
    51 %  textOut(sprintf(['If logging is enabled, this goes to the logfile, ', ... 
    52 %                   'if not, this goes nowhere\n'])); 
     49%+  global DisableScreenOut 
     50%+  DisableScreenOut = true; 
     51%+  textOut(sprintf(['If logging is enabled, this goes to the logfile, ', ... 
     52%+                   'if not, this goes nowhere\n'])); 
    5353% 
    5454% 
     
    5858%   Copyright: 2007-2008, RWTH Aachen University 
    5959% 
     60; 
    6061% 
    6162% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/tictic.m

    r201 r282  
    33 
    44% Syntax 
    5 %   tictic(id)  
     5%   |tictic(id)|  
    66% 
    77% Description 
    8 %   tictic(id) will start tic command determined by a specific id. E.g. 
     8%   |tictic(id)| will start tic command determined by a specific |id|. E.g. 
    99%   tictic(3) will not influence measurements of tictic(2).  
    1010% 
    1111% Note: 
    12 %   Do not use too large values for id, as they will take up memory. Also 
     12%   Do not use too large values for |id|, as they will take up memory. Also 
    1313%   make sure that you do not mix up those tictic ids. 
    1414%   Note that toctoc() does not generate a screen output like toc() does. 
    1515% 
    1616% Example 
    17 %   id = 7; 
    18 %   tictic(id); 
    19 %      % do something... 
    20 %   timeTaken = toctoc(id); 
     17%+   id = 7; 
     18%+   tictic(id); 
     19%+      % do something... 
     20%+   timeTaken = toctoc(id); 
    2121% 
    2222% See also: toctoc 
     
    2727%   Copyright: 2007-2008, RWTH Aachen University 
    2828% 
     29; 
    2930% 
    3031% *********************************************************************************************** 
  • branches/telle/RWTHMindstormsNXT-Lejos/toctoc.m

    r201 r282  
    33 
    44% Syntax 
    5 %   seconds = toctoc(id)  
     5%   |seconds = toctoc(id)|  
    66% 
    77% Description 
    8 %   toctoc(id) returns the time taken (in seconds) since the call to 
    9 %   tictic(id) with the same id. Each id generates independent results, 
     8%   |toctoc(id)| returns the time taken (in seconds) since the call to 
     9%   |tictic(id)| with the same |id|. Each |id| generates independent results, 
    1010%   e.g. toctoc(3) will not be influenced by the start of tictic(2).  
    1111% 
    1212% Note: 
    13 %   Do not use too large values for id, as they will take up memory. Also 
     13%   Do not use too large values for |id|, as they will take up memory. Also 
    1414%   make sure that you do not mix up those tictic ids. 
    1515%   Note that toctoc() does not generate a screen output like toc() does. 
    1616% 
    1717% Example 
    18 %   id = 7; 
    19 %   tictic(id); 
    20 %      % do something... 
    21 %   timeTaken = toctoc(id); 
     18%+   id = 7; 
     19%+   tictic(id); 
     20%+      % do something... 
     21%+   timeTaken = toctoc(id); 
    2222% 
    2323% See also: tictic 
     
    2828%   Copyright: 2007-2008, RWTH Aachen University 
    2929% 
     30; 
    3031% 
    3132% ***********************************************************************************************