Changeset 615
- Timestamp:
- 06/23/09 18:28:19 (4 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
- 4 moved
-
ReadMe.txt (modified) (1 diff)
-
demos/Example_1_PlayTone.m (modified) (2 diffs)
-
demos/Example_2_ReadSoundSensor.m (modified) (2 diffs)
-
demos/Example_3_DriveAroundTable.m (modified) (2 diffs)
-
demos/Example_4_DriveAroundTable_MotorClass.m (moved) (moved from trunk/demos/Example_7_DriveAroundTable_MotorClass.m) (3 diffs)
-
demos/Example_5_DriveUntilWall.m (moved) (moved from trunk/demos/Example_4_DriveUntilWall.m) (1 diff)
-
demos/Example_6_NextGenerationUltrasound.m (moved) (moved from trunk/demos/Example_5_NextGenerationUltrasound.m)
-
demos/Example_7_ShinyRadar.m (moved) (moved from trunk/demos/Example_6_ShinyRadar.m) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ReadMe.txt
r197 r615 3 3 /trunk 4 4 5 /demos : Folder includes all MATLAB demo files5 /demos : Folder includes all MATLAB demo files 6 6 7 7 /doc 8 /html: Html documentation files for the MATLAB toolbox help9 /functions (e.g.)10 /m2html: Folder includes MATLAB scripts which are published automatically8 /html : Html documentation files for the MATLAB toolbox help 9 /functions (e.g.) 10 /m2html : Folder includes MATLAB scripts which are published automatically 11 11 12 /mfiles : Folder includes all MATLAB files of the toolbox13 /private12 /mfiles : Folder includes all MATLAB files of the toolbox 13 /private 14 14 15 15 /publishing 16 /output: Output folder for the toolbox --> TARGET17 /scripts: Own scripts to produce a whole toolbox structure18 /tools: Tools for publishing process19 /3rdParties: 3rd party tools16 /output : Output folder for the toolbox --> TARGET 17 /scripts : Own scripts to produce a whole toolbox structure 18 /tools : Tools for publishing process 19 /3rdParties : 3rd party tools 20 20 21 /root : Files which are copied in the root folder of the toolbox 22 21 /root : Files which are copied in the root folder of the toolbox 23 22 24 /tools : Additional tools for the toolbox 25 /LinuxConnection : e.g. bt_connect script 23 24 /tools : Additional tools for the toolbox 25 /LinuxConnection : e.g. bt_connect script 26 /MotorControl : Advanced Motor Control (NXC program) 27 -
trunk/demos/Example_1_PlayTone.m
r512 r615 1 1 %% Example 1: Play Tone and Get Battery Level 2 2 % Example to play a specific tone with the NXT Brick and retrieve the current battery level: 3 %4 3 5 4 % Close previous handles (if existing) … … 9 8 close all 10 9 11 % Open new NXT connection according to the previous generated configuration file. 12 handle = COM_OpenNXT('bluetooth.ini', 'check'); 13 COM_SetDefaultNXT(handle); 10 % Open new NXT connection 11 % - Tries to open a connection via USB. The first NXT device that is found will be used. 12 % - Device drivers (Fantom on Windows, libusb on Linux) have to be already installed for USB to work. 13 % - For using Bluetooth a previous configuration file has to be generated COM_MakeBTConfigFile) 14 handle = COM_OpenNXT(); 14 15 15 % Play tone with frequency 800Hz and duration of 500ms.16 NXT_PlayTone(800,500 );16 % Play tone with frequency 800Hz and duration of 500ms. 17 NXT_PlayTone(800,500, handle); 17 18 18 % Get current battery level.19 voltage = NXT_GetBatteryLevel 19 % Get current battery level. 20 voltage = NXT_GetBatteryLevel(handle) 20 21 21 % Close Bluetoothconnection.22 % Close NXT connection. 22 23 COM_CloseNXT(handle); -
trunk/demos/Example_2_ReadSoundSensor.m
r512 r615 1 1 %% Example 2: Read Sound Sensor 2 2 % Example to read the sound sensor value in db: 3 4 3 5 4 % Close previous handles (if existing) … … 9 8 close all 10 9 11 % Open new NXT connection according to the previous generated configuration file.10 % Open new NXT Bluetooth connection according to the previous generated configuration file. 12 11 handle = COM_OpenNXT('bluetooth.ini', 'check'); 12 13 % Set current NXT handle as default for subsequent toolbox function calls 13 14 COM_SetDefaultNXT(handle); 14 15 15 % Set the correctsound sensor mode and input port.16 % Initialize the sound sensor by setting the sound sensor mode and input port. 16 17 OpenSound(SENSOR_2, 'DB'); 17 18 -
trunk/demos/Example_3_DriveAroundTable.m
r512 r615 1 %% Example 3: Drive Around Table 1 %% Example 3: Drive Around Table (Basic Motor Commands) 2 2 % In this little demo, our bot drives a square on the floor around a well known table. 3 % 4 % Note: This example uses the basic motor commands, which are based on the LEGO NXT direct commands 5 % specified by the LEGO Communication Protocol. For advanced motor control (more precise motor 6 % control) and a more intuitive usability we recommend the advanced motor control commands (see 7 % example 4). 3 8 4 9 %% Clear and close … … 13 18 14 19 15 %% Open NXT connection 20 %% Open NXT connection (Bluetooth) 16 21 handle = COM_OpenNXT('bluetooth.ini', 'check'); 17 COM_SetDefaultNXT(handle); 22 COM_SetDefaultNXT(handle); % set NXT handle as the default handle 18 23 19 24 -
trunk/demos/Example_4_DriveAroundTable_MotorClass.m
r449 r615 1 %% Example 7: Drive Around Table v2 2 % This example equals demo 3, but uses the motor class for motor control. 1 %% Example 7: Drive Around Table (Motor Class) 2 % This example equals demo 3, but uses the motor class and an advanced motor control. 3 % 4 % Note: For using the advanced motor control the MotorControl program has to be downloaded onto your 5 % NXT. The MotorControl program is located at /tools/MotorControl. 6 3 7 4 8 %% Clear and close … … 10 14 %% Constants and so on 11 15 TableLength = 1000; % in degrees of motor rotations :-) 12 QuarterTurnTicks = 217; % in motor degrees, how much is a 90° turn of the bot?13 Ports = [MOTOR_B; MOTOR_C]; % motorports for left and right wheel14 DrivingSpeed = 50;15 TurningSpeed = 30;16 QuarterTurnTicks = 217; % in motor degrees, how much is a 90° turn of the bot? 17 Ports = [MOTOR_B; MOTOR_C]; % motorports for left and right wheel 18 DrivingSpeed = 50; 19 TurningSpeed = 30; 16 20 17 21 18 %% Open Bluetooth /USBconnetion22 %% Open Bluetooth connetion 19 23 h = COM_OpenNXT('bluetooth.ini', 'check'); 20 24 COM_SetDefaultNXT(h); … … 83 87 84 88 85 %% Close Bluetooth 89 %% Close Bluetooth connection 86 90 COM_CloseNXT(h); -
trunk/demos/Example_5_DriveUntilWall.m
r512 r615 14 14 15 15 16 %% Initialize NXT connection 16 %% Initialize NXT connection (Bluetooth) 17 17 handle = COM_OpenNXT('bluetooth.ini', 'check'); 18 18 COM_SetDefaultNXT(handle); -
trunk/demos/Example_7_ShinyRadar.m
r358 r615 1 1 %% Example 6: ShinyRadar 2 2 % This function provides a live moving ultrasonic radar. 3 % 4 % Note: This demo uses an robot with a rotating ultrasonic sensor. 3 5 4 5 function ShinyRadar 6 function Example_7_ShinyRadar 6 7 7 8 %% Clean up previous handles
