Changeset 293

Show
Ignore:
Timestamp:
09/25/08 09:32:43 (5 years ago)
Author:
behrens
Message:

replace f_sensorport with port, add comment

Location:
branches/atorf/RWTHMindstormsNXT
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/atorf/RWTHMindstormsNXT/COM_ReadI2C.m

    r288 r293  
    2828%    Default value is 0x02 (2 in decimal). Finally, |RegisterAddress| is 
    2929%    the address where you want to read data from. For the ultrasound and 
    30 %    many other sensors, the "data section" starts at 0x24 (66 in decimal). 
     30%    many other sensors, the "data section" starts at 0x42 (66 in decimal). 
    3131% 
    3232%    As last argument you can pass a valid NXT-handle to be used from this 
  • branches/atorf/RWTHMindstormsNXT/USGetSnapshotResults.m

    r275 r293  
    1 function snaps = USGetSnapshotResults(f_sensorport) 
     1function snaps = USGetSnapshotResults(port) 
    22% Retrieves up to eight echos (distances) stored inside the US sensor 
    33% 
     
    6565 
    6666    % also accept strings as input 
    67     if ischar(f_sensorport) 
    68         f_sensorport = str2double(f_sensorport); 
     67    if ischar(port) 
     68        port = str2double(port); 
    6969    end%if 
    7070 
     
    7575    %I2Cdata(1) = hex2dec('02'); % the default I2C address for a port.  
    7676    %I2Cdata(2) = hex2dec('42'); % READ! 
    77     %NXT_LSWrite(f_sensorport, RequestLen, I2Cdata, 'dontreply'); 
     77    %NXT_LSWrite(port, RequestLen, I2Cdata, 'dontreply'); 
    7878 
    7979    % retrieve 8 bytes from device 0x02, register 0x42 
    80     data = COM_ReadI2C(f_sensorport, 8, uint8(2), uint8(66)); 
     80    data = COM_ReadI2C(port, 8, uint8(2), uint8(66)); 
    8181     
    8282    if ~isempty(data) 
  • branches/atorf/RWTHMindstormsNXT/USMakeSnapshot.m

    r153 r293  
    1 function USMakeSnapshot(f_sensorport) 
     1function USMakeSnapshot(port) 
    22% Causes the ultrasonic sensor to send one snapshot ("ping") and record the echos 
    33% 
     
    5454 
    5555    % also accept strings as input 
    56     if ischar(f_sensorport) 
    57         f_sensorport = str2double(f_sensorport); 
     56    if ischar(port) 
     57        port = str2double(port); 
    5858    end%if 
    5959 
     
    7171    I2Cdata(3) = hex2dec('01'); % SINGLE_SHOT 
    7272 
    73     NXT_LSWrite(f_sensorport, RequestLen, I2Cdata, 'dontreply'); 
     73    NXT_LSWrite(port, RequestLen, I2Cdata, 'dontreply'); 
    7474 
    7575