Table of Contents
Screenshots
RWTH - Mindstorms NXT Toolbox
click thumbnails to enlarge
| | | |
|
| Toolbox documentation | Sensor Reading | Functions by Category | Watch Analog Sensor GUI | Program Examples |
Promotion Video
by Nene Vasquez and Angel Chacin - 30.06.2010
Applications
Roboarm
click thumbnails to enlarge
| | | |
|
| Roboarm | Roboarm | GUI for monitoring | GUI for controlling | Example Code |
Arguments of Complex Numbers
click thumbnails to enlarge
| | |
|
| LEGO machine | Input dialog | Machine output | Visualization of calculated argument |
Weighing machine
For more details on this weighing machine ("The resplendent Roman balance" built by University of Cambridge), see here.
click thumbnails to enlarge
|
|
| Weighing machine | Results plot |
Code Examples
Play Tone and Get Battery Level
Example to play a specific tone with the NXT Brick and retrieve the current battery level:
Prepare workspace by cleaning all old settings to be on the safe side.
COM_CloseNXT all close all clear all
% Open new Bluetooth connection according to the previously generated configuration file. handle = COM_OpenNXT('bluetooth.ini'); COM_SetDefaultNXT(handle);
% Play tone with frequency 800Hz and duration of 500ms. NXT_PlayTone(800,500);
% Get current battery level. voltage = NXT_GetBatteryLevel
% Close Bluetooth connection. COM_CloseNXT(handle);
Published with MATLAB® 7.5
Read Sound Sensor
Example to read the sound sensor value in db: Prepare workspace by cleaning all old settings to be on the safe side.
COM_CloseNXT all close all clear all
% Open new Bluetooth connection according to the previously generated configuration file. handle = COM_OpenNXT('bluetooth.ini'); COM_SetDefaultNXT(handle);
% Set the correct sound sensor mode and input port. OpenSound(SENSOR_2, 'DB');
% Get the current sound sensor value in dB. value = GetSound(SENSOR_2)
% Close the sound sensor. CloseSensor(SENSOR_2);
% Close Bluetooth connection. COM_CloseNXT(handle);
Published with MATLAB® 7.5
Drive Around Table (Motor Class)
Clear and close
COM_CloseNXT all clear all close allConstants and so on
TableLength = 1000; % in degrees of motor rotations :-) QuarterTurnTicks = 219; % in motor degrees, how much is a 90° turn of the bot? Ports = [MOTOR_B; MOTOR_C]; % motorports for left and right wheel DrivingSpeed = 60; TurningSpeed = 40;Open Bluetooth connetion
h = COM_OpenNXT('bluetooth.ini'); COM_SetDefaultNXT(h);Initialize motor-objects:
mStraight = NXTMotor(Ports); % next command since we are driving in SYNC-mode. This should not be % necessary with correct default values, but at the moment, I have to set % it manually, mStraight.SpeedRegulation = false; % not for sync mode mStraight.Power = DrivingSpeed; mStraight.TachoLimit = TableLength; mStraight.ActionAtTachoLimit = 'Brake'; mTurn1 = NXTMotor(Ports(2)); % ports swapped because it's nicer mTurn1.SpeedRegulation = false; % we could use it if we wanted mTurn1.Power = TurningSpeed; mTurn1.TachoLimit = QuarterTurnTicks; mStraight.ActionAtTachoLimit = 'Brake'; mTurn2 = mTurn1; mTurn2.Port = Ports(1); % ports swapped again... mTurn2.Power = - mTurn1.Power;Initialize Motors...
% we send this in case they should still be spinning or something... mStraight.Stop('off');Start the engines, main loop begins (repeated 4 times)
% 4 times because we got 4 equal sides of the table :-) for j = 1 : 4Drive
mStraight.SendToNXT();Wait for the end end of table
mStraight.WaitFor();Now please turn
mTurn1.SendToNXT(); mTurn1.WaitFor(); mTurn2.SendToNXT(); mTurn2.WaitFor();Thats it. Repeat 4 times....
end%forDone.
% Hey! End of a hard day's work Just to show good style, we close down our motors again: mStraight.Stop('off');Close Bluetooth connection
COM_CloseNXT(h);
Published with MATLAB® 7.13
Attachments
-
complex_numbers_01.jpg
(64.0 KB) - added by behrens
5 years ago.
-
complex_numbers_02.png
(7.0 KB) - added by behrens
5 years ago.
-
complex_numbers_03.png
(68.9 KB) - added by behrens
5 years ago.
-
complex_numbers_04.png
(15.8 KB) - added by behrens
5 years ago.
-
roboarm_01.jpg
(134.8 KB) - added by behrens
5 years ago.
-
roboarm_02.jpg
(129.4 KB) - added by behrens
5 years ago.
-
roboarm_03.jpg
(5.9 KB) - added by behrens
5 years ago.
-
roboarm_04.jpg
(13.0 KB) - added by behrens
5 years ago.
-
screenshot_toolbox_04.jpg
(110.6 KB) - added by behrens
5 years ago.
-
roboarm_05.jpg
(42.5 KB) - added by behrens
5 years ago.
-
screenshot_toolbox_02.jpg
(109.0 KB) - added by behrens
5 years ago.
-
screenshot_toolbox_03.jpg
(185.3 KB) - added by behrens
5 years ago.
-
screenshot_toolbox_05.jpg
(44.9 KB) - added by behrens
5 years ago.
-
screenshot_toolbox_01.jpg
(209.1 KB) - added by behrens
5 years ago.
-
screenshot_toolbox_01.png
(70.6 KB) - added by atorf
3 years ago.
-
balance_1.jpg
(152.5 KB) - added by atorf
3 years ago.
Balance bot from University of Cambridge
-
balance_traces.jpg
(46.2 KB) - added by atorf
3 years ago.
Balance plot from University of Cambridge
















